... |
... |
@@ -45,6 +45,27 @@ def test_include_missing_file(cli, tmpdir): |
45
|
45
|
assert 'line 4 column 2' in result.stderr
|
46
|
46
|
|
47
|
47
|
|
|
48
|
+def test_include_dir(cli, tmpdir):
|
|
49
|
+ tmpdir.join('project.conf').write('{"name": "test"}')
|
|
50
|
+ tmpdir.mkdir('subdir')
|
|
51
|
+ element = tmpdir.join('include_dir.bst')
|
|
52
|
+
|
|
53
|
+ # Normally we would use dicts and _yaml.dump to write such things, but here
|
|
54
|
+ # we want to be sure of a stable line and column number.
|
|
55
|
+ element.write(textwrap.dedent("""
|
|
56
|
+ kind: manual
|
|
57
|
+
|
|
58
|
+ "(@)":
|
|
59
|
+ - subdir/
|
|
60
|
+ """).strip())
|
|
61
|
+
|
|
62
|
+ result = cli.run(project=str(tmpdir), args=['show', str(element.basename)])
|
|
63
|
+ result.assert_main_error(
|
|
64
|
+ ErrorDomain.LOAD, LoadErrorReason.LOADING_DIRECTORY)
|
|
65
|
+ # Make sure the root cause provenance is in the output.
|
|
66
|
+ assert 'line 4 column 2' in result.stderr
|
|
67
|
+
|
|
68
|
+
|
48
|
69
|
@pytest.mark.datafiles(DATA_DIR)
|
49
|
70
|
def test_include_junction_file(cli, tmpdir, datafiles):
|
50
|
71
|
project = os.path.join(str(datafiles), 'junction')
|
... |
... |
@@ -65,7 +86,7 @@ def test_include_junction_file(cli, tmpdir, datafiles): |
65
|
86
|
|
66
|
87
|
|
67
|
88
|
@pytest.mark.datafiles(DATA_DIR)
|
68
|
|
-def test_include_junction_options(cli, tmpdir, datafiles):
|
|
89
|
+def test_include_junction_options(cli, datafiles):
|
69
|
90
|
project = os.path.join(str(datafiles), 'options')
|
70
|
91
|
|
71
|
92
|
result = cli.run(project=project, args=[
|
... |
... |
@@ -146,7 +167,7 @@ def test_junction_element_not_partial_project_file(cli, tmpdir, datafiles): |
146
|
167
|
|
147
|
168
|
|
148
|
169
|
@pytest.mark.datafiles(DATA_DIR)
|
149
|
|
-def test_include_element_overrides(cli, tmpdir, datafiles):
|
|
170
|
+def test_include_element_overrides(cli, datafiles):
|
150
|
171
|
project = os.path.join(str(datafiles), 'overrides')
|
151
|
172
|
|
152
|
173
|
result = cli.run(project=project, args=[
|
... |
... |
@@ -161,7 +182,7 @@ def test_include_element_overrides(cli, tmpdir, datafiles): |
161
|
182
|
|
162
|
183
|
|
163
|
184
|
@pytest.mark.datafiles(DATA_DIR)
|
164
|
|
-def test_include_element_overrides_composition(cli, tmpdir, datafiles):
|
|
185
|
+def test_include_element_overrides_composition(cli, datafiles):
|
165
|
186
|
project = os.path.join(str(datafiles), 'overrides')
|
166
|
187
|
|
167
|
188
|
result = cli.run(project=project, args=[
|
... |
... |
@@ -176,7 +197,7 @@ def test_include_element_overrides_composition(cli, tmpdir, datafiles): |
176
|
197
|
|
177
|
198
|
|
178
|
199
|
@pytest.mark.datafiles(DATA_DIR)
|
179
|
|
-def test_include_element_overrides_sub_include(cli, tmpdir, datafiles):
|
|
200
|
+def test_include_element_overrides_sub_include(cli, datafiles):
|
180
|
201
|
project = os.path.join(str(datafiles), 'sub-include')
|
181
|
202
|
|
182
|
203
|
result = cli.run(project=project, args=[
|
... |
... |
@@ -210,7 +231,7 @@ def test_junction_do_not_use_included_overrides(cli, tmpdir, datafiles): |
210
|
231
|
|
211
|
232
|
|
212
|
233
|
@pytest.mark.datafiles(DATA_DIR)
|
213
|
|
-def test_conditional_in_fragment(cli, tmpdir, datafiles):
|
|
234
|
+def test_conditional_in_fragment(cli, datafiles):
|
214
|
235
|
project = os.path.join(str(datafiles), 'conditional')
|
215
|
236
|
|
216
|
237
|
result = cli.run(project=project, args=[
|
... |
... |
@@ -240,7 +261,7 @@ def test_inner(cli, datafiles): |
240
|
261
|
|
241
|
262
|
|
242
|
263
|
@pytest.mark.datafiles(DATA_DIR)
|
243
|
|
-def test_recursive_include(cli, tmpdir, datafiles):
|
|
264
|
+def test_recursive_include(cli, datafiles):
|
244
|
265
|
project = os.path.join(str(datafiles), 'recursive')
|
245
|
266
|
|
246
|
267
|
result = cli.run(project=project, args=[
|