Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_smoke_app():
repository_container = app.RepositoryContainer(repository=define_example_repository())
pipeline_run_storage = PipelineRunStorage()
flask_app = app.create_app(repository_container, pipeline_run_storage)
client = flask_app.test_client()
result = client.post('/graphql', data={'query': 'query { pipelines { nodes { name }}}'})
data = json.loads(result.data.decode('utf-8'))
assert data == {"data": {"pipelines": {"nodes": [{"name": "pandas_hello_world"}]}}}
def test_smoke_app():
repository_container = app.RepositoryContainer(repository=define_example_repository())
pipeline_run_storage = PipelineRunStorage()
flask_app = app.create_app(repository_container, pipeline_run_storage)
client = flask_app.test_client()
result = client.post('/graphql', data={'query': 'query { pipelines { nodes { name }}}'})
data = json.loads(result.data.decode('utf-8'))
assert len(data['data']['pipelines']['nodes']) == 2
assert set([node_data['name'] for node_data in data['data']['pipelines']['nodes']]) == set(
['pandas_hello_world', 'pandas_hello_world_fails']
)
def test_smoke_app():
repository_container = app.RepositoryContainer(repository=define_example_repository())
pipeline_run_storage = PipelineRunStorage()
flask_app = app.create_app(repository_container, pipeline_run_storage)
client = flask_app.test_client()
result = client.post('/graphql', data={'query': 'query { pipelines { nodes { name }}}'})
data = json.loads(result.data.decode('utf-8'))
assert data == {"data": {"pipelines": {"nodes": [{"name": "pandas_hello_world"}]}}}
def test_smoke_app():
repository_container = app.RepositoryContainer(repository=define_example_repository())
pipeline_run_storage = PipelineRunStorage()
flask_app = app.create_app(repository_container, pipeline_run_storage)
client = flask_app.test_client()
result = client.post('/graphql', data={'query': 'query { pipelines { nodes { name }}}'})
data = json.loads(result.data.decode('utf-8'))
assert len(data['data']['pipelines']['nodes']) == 2
assert set([node_data['name'] for node_data in data['data']['pipelines']['nodes']]) == set(
['pandas_hello_world', 'pandas_hello_world_fails']
)
def test_smoke_app():
flask_app = app.create_app(
ExecutionTargetHandle.for_repo_module(
module_name='dagster_examples.intro_tutorial.repos', fn_name='define_repo'
),
DagsterInstance.ephemeral(),
)
client = flask_app.test_client()
result = client.post('/graphql', data={'query': 'query { pipelines { nodes { name }}}'})
data = json.loads(result.data.decode('utf-8'))
assert len(data['data']['pipelines']['nodes']) == 2
assert {node_data['name'] for node_data in data['data']['pipelines']['nodes']} == set(
['hello_cereal_pipeline', 'complex_pipeline']
)
result = client.get('/graphql')
assert result.status_code == 400