Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tests: Normalise schema spelling when comparing #339

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion tests/main/test_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -367,4 +367,11 @@ def test_main_generates_correct_schema_file(project_dir, file_name, expected_fil
assert result.exit_code == 0
schema_path = project_dir / file_name

assert schema_path.read_text() == expected_file_path.read_text()
# normalise texts to account for a spelling change in graphql-core 3.2.5
def normalise(schema: str) -> str:
return schema.replace(" behaviour ", " behavior ")

actual = normalise(schema_path.read_text())
expected = normalise(expected_file_path.read_text())

assert actual == expected