Skip to content

Commit

Permalink
More tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ekampf committed Jan 8, 2019
1 parent 0713f64 commit c125c2e
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions tests/test_renderer_dataclasses.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,26 @@ def github_dataclass_renderer(swapi_schema):
return DataclassesRenderer(swapi_schema, Config(schema='schemaurl', endpoint='schemaurl', documents=''))


def test_renders_custom_headers(swapi_schema, swapi_parser, module_compiler):
query = """
query GetFilm {
returnOfTheJedi: film(id: "1") {
title
director
}
}
"""

custom_header = '# Works!'
renderer = DataclassesRenderer(swapi_schema, Config(schema='schemaurl', endpoint='schemaurl', documents='', custom_header=custom_header))

parsed = swapi_parser.parse(query)
rendered = renderer.render(parsed)

assert rendered
assert custom_header in rendered


def test_simple_query(swapi_dataclass_renderer, swapi_parser, module_compiler):
query = """
query GetFilm {
Expand Down

0 comments on commit c125c2e

Please sign in to comment.