... |
... |
@@ -136,3 +136,23 @@ def test_stage_file_exists(cli, tmpdir, datafiles): |
136
|
136
|
result = cli.run(project=project, args=['build', 'target.bst'])
|
137
|
137
|
result.assert_main_error(ErrorDomain.STREAM, None)
|
138
|
138
|
result.assert_task_error(ErrorDomain.SOURCE, 'ensure-stage-dir-fail')
|
|
139
|
+
|
|
140
|
+
|
|
141
|
+@pytest.mark.datafiles(os.path.join(DATA_DIR, 'directory'))
|
|
142
|
+def test_stage_directory_symlink(cli, tmpdir, datafiles):
|
|
143
|
+ project = os.path.join(datafiles.dirname, datafiles.basename)
|
|
144
|
+ checkoutdir = os.path.join(str(tmpdir), "checkout")
|
|
145
|
+
|
|
146
|
+ symlink = os.path.join(project, 'files', 'symlink-to-subdir')
|
|
147
|
+ os.symlink('subdir', symlink)
|
|
148
|
+
|
|
149
|
+ # Build, checkout
|
|
150
|
+ result = cli.run(project=project, args=['build', 'target.bst'])
|
|
151
|
+ result.assert_success()
|
|
152
|
+ result = cli.run(project=project, args=['artifact', 'checkout', 'target.bst', '--directory', checkoutdir])
|
|
153
|
+ result.assert_success()
|
|
154
|
+
|
|
155
|
+ # Check that the checkout contains the expected directory and directory symlink
|
|
156
|
+ assert(os.path.exists(os.path.join(checkoutdir, 'subdir', 'anotherfile.txt')))
|
|
157
|
+ assert(os.path.exists(os.path.join(checkoutdir, 'symlink-to-subdir', 'anotherfile.txt')))
|
|
158
|
+ assert(os.path.islink(os.path.join(checkoutdir, 'symlink-to-subdir')))
|