Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
dromer committed Dec 20, 2024
1 parent 5289bcd commit c7493ed
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@ coverage.xml
.pytest_cache/
cover/

# Unit test output
tests/src/create_test_midi

# Translations
*.mo
*.pot
Expand Down
8 changes: 4 additions & 4 deletions tests/framework/base_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,26 +69,26 @@ def _run_hvcc(
# TODO(mhroth): standardise how errors and warnings are returned between stages
if r.notifs.has_error:
if r.stage == "pd2hv":
self.fail(hvcc_results["pd2hv"].notifs.errors[0])
self.fail(hvcc_results.root["pd2hv"].notifs.errors[0])
else:
self.fail(str(r.notifs))

if expect_warning:
for r in hvcc_results.root.values():
if r.stage == "pd2hv":
self.assertTrue(
expected_enum in [w.enum for w in hvcc_results["pd2hv"].notifs.warnings]
expected_enum in [w.enum for w in hvcc_results.root["pd2hv"].notifs.warnings]
)
return

self.fail(f"Expected warning enum: {expected_enum}")

if expect_fail and r.notifs.has_error:
if r.stage == "pd2hv":
self.assertTrue(expected_enum in [e.enum for e in hvcc_results["pd2hv"].notifs.errors])
self.assertTrue(expected_enum in [e.enum for e in hvcc_results.root["pd2hv"].notifs.errors])
return
elif r.stage == "hvcc":
if len(hvcc_results["hvcc"].notifs.errors) > 0:
if len(hvcc_results.root["hvcc"].notifs.errors) > 0:
return # hvcc isn't using Notification enums so just pass

self.fail(f"Expected error enum: {expected_enum}")
Expand Down

0 comments on commit c7493ed

Please sign in to comment.