... |
... |
@@ -283,11 +283,10 @@ def test_help_commands(cli, cmd, word_idx, expected): |
283
|
283
|
assert_completion(cli, cmd, word_idx, expected)
|
284
|
284
|
|
285
|
285
|
|
286
|
|
-@pytest.mark.datafiles(DATA_DIR)
|
|
286
|
+@pytest.mark.datafiles(os.path.join(DATA_DIR, 'project'))
|
287
|
287
|
@pytest.mark.integration
|
288
|
|
-def test_argument_artifact(datafiles, cli):
|
289
|
|
- project = os.path.join(datafiles.dirname, datafiles.basename, 'project')
|
290
|
|
- cwd = os.path.join(project)
|
|
288
|
+def test_argument_artifact(cli, tmpdir, datafiles):
|
|
289
|
+ project = os.path.join(datafiles.dirname, datafiles.basename)
|
291
|
290
|
|
292
|
291
|
# Build an import element with no dependencies (as there will only be ONE cache key)
|
293
|
292
|
result = cli.run(project=project, args=['build', 'import-bin.bst']) # Has no dependencies
|
... |
... |
@@ -306,14 +305,15 @@ def test_argument_artifact(datafiles, cli): |
306
|
305
|
|
307
|
306
|
for i, cmd in enumerate(cmds):
|
308
|
307
|
word_idx = 3
|
309
|
|
- result = cli.run(project=project, cwd=cwd, env={
|
|
308
|
+ result = cli.run(project=project, cwd=project, env={
|
310
|
309
|
'_BST_COMPLETION': 'complete',
|
311
|
310
|
'COMP_WORDS': cmd,
|
312
|
311
|
'COMP_CWORD': str(word_idx)
|
313
|
312
|
})
|
314
|
313
|
words = []
|
315
|
314
|
if result.output:
|
316
|
|
- words = result.output.splitlines()
|
|
315
|
+ words = result.output.splitlines() # This leaves an extra space on each e.g. ['foo.bst ']
|
|
316
|
+ words = [word.strip() for word in words]
|
317
|
317
|
|
318
|
318
|
if i == 0:
|
319
|
319
|
expected = PROJECT_ELEMENTS + [artifact] # We should now be able to see the artifact
|
... |
... |
@@ -322,4 +322,4 @@ def test_argument_artifact(datafiles, cli): |
322
|
322
|
elif i == 2:
|
323
|
323
|
expected = [artifact]
|
324
|
324
|
|
325
|
|
- assert artifact in words
|
|
325
|
+ assert expected == words
|