Skip to content

Commit 17775ca

Browse files
committed
fix most (all?) tests
1 parent 8c0a714 commit 17775ca

File tree

10 files changed

+22
-23
lines changed

10 files changed

+22
-23
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
../../../../../headers/validation.h
1+
../../../../../bapctools/resources/headers/validation.h
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
../../../../../headers/validation.h
1+
../../../../../bapctools/resources/headers/validation.h
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
../../../../headers/validation.h
1+
../../../../bapctools/resources/headers/validation.h
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
../../../../../headers/validation.h
1+
../../../../../bapctools/resources/headers/validation.h
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
../../../../../headers/validation.h
1+
../../../../../bapctools/resources/headers/validation.h

test/test_default_output_validator.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,7 @@
55
import tempfile
66
from pathlib import Path
77

8-
import problem
9-
import testcase
10-
import validate
11-
import util
12-
import config
8+
from bapctools import problem, testcase, validate, util, config
139

1410
RUN_DIR = Path.cwd().absolute()
1511
# Note: the python version isn't tested by default, because it's quite slow.
@@ -49,7 +45,7 @@ def validator(request):
4945
tmpdir = Path(tempfile.gettempdir()) / ("bapctools_" + h)
5046
tmpdir.mkdir(exist_ok=True)
5147
p = problem.Problem(Path("."), tmpdir)
52-
validator = validate.OutputValidator(p, RUN_DIR / "support" / request.param)
48+
validator = validate.OutputValidator(p, config.RESOURCES_ROOT / "support" / request.param)
5349
print(util.ProgressBar.current_bar)
5450
bar = util.ProgressBar("build", max_len=1)
5551
validator.build(bar)

test/test_generators_yaml.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@
33
import yaml
44
from pathlib import Path
55

6-
import generate
7-
import config
6+
from bapctools import generate, config
87

98
config.RUNNING_TEST = True
109

test/test_problem_yaml.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@
44
from typing import cast, Any
55
from unittest.mock import call, MagicMock
66

7-
import config
8-
import problem
7+
from bapctools import config, problem
98

109
RUN_DIR = Path.cwd().absolute()
1110

@@ -72,7 +71,7 @@ def test_invalid(self, monkeypatch, test_data):
7271
fatal = MagicMock(name="fatal", side_effect=SystemExit(-42))
7372
error = MagicMock(name="error")
7473
warn = MagicMock(name="warn")
75-
for module in ["problem", "util"]:
74+
for module in ["bapctools.problem", "bapctools.util"]:
7675
monkeypatch.setattr(f"{module}.fatal", fatal)
7776
monkeypatch.setattr(f"{module}.error", error)
7877
monkeypatch.setattr(f"{module}.warn", warn)

test/test_problems.py

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,7 @@
44
from pathlib import Path
55
from zipfile import ZipFile
66

7-
import tools
8-
import problem
9-
import config
10-
import util
7+
from bapctools import cli as tools, problem, config, util
118

129
# Run `bt run` on these problems.
1310
PROBLEMS = [
@@ -195,7 +192,11 @@ def test_zip(self):
195192
info.filename for info in ZipFile(zip_path).infolist() if info.filename.endswith(".pdf")
196193
) == [
197194
f"identity/{path}.{lang}.pdf"
198-
for path in ["problem_slide/problem-slide", "solution/solution", "statement/problem"]
195+
for path in [
196+
"problem_slide/problem-slide",
197+
"solution/solution",
198+
"statement/problem",
199+
]
199200
for lang in ["de", "en"]
200201
], "Zip contents for PDFs with both languages are not correct"
201202

@@ -206,7 +207,11 @@ def test_zip(self):
206207
info.filename for info in ZipFile(zip_path).infolist() if info.filename.endswith(".pdf")
207208
) == [
208209
f"identity/{path}.en.pdf"
209-
for path in ["problem_slide/problem-slide", "solution/solution", "statement/problem"]
210+
for path in [
211+
"problem_slide/problem-slide",
212+
"solution/solution",
213+
"statement/problem",
214+
]
210215
], "Zip contents for PDFs with `--lang en` are not correct"
211216

212217
zip_path.unlink()

test/test_verdicts.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import verdicts
1+
from bapctools import verdicts
22

33

44
class MockTestcase:

0 commit comments

Comments
 (0)