Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def load_dagit_for_repo_cli_args(n_pipelines=1, **kwargs):
handle = handle_for_repo_cli_args(kwargs)
app = create_app(handle, DagsterInstance.ephemeral())
client = app.test_client()
res = client.get('/graphql?query={query_string}'.format(query_string=PIPELINES_OR_ERROR_QUERY))
json_res = json.loads(res.data.decode('utf-8'))
assert 'data' in json_res
assert 'pipelinesOrError' in json_res['data']
assert 'nodes' in json_res['data']['pipelinesOrError']
assert len(json_res['data']['pipelinesOrError']['nodes']) == n_pipelines
return res
def load_dagit_for_repo_cli_args(n_pipelines=1, **kwargs):
handle = handle_for_repo_cli_args(kwargs)
app = create_app(handle, DagsterInstance.ephemeral())
client = app.test_client()
res = client.get('/graphql?query={query_string}'.format(query_string=PIPELINES_OR_ERROR_QUERY))
json_res = json.loads(res.data.decode('utf-8'))
assert 'data' in json_res
assert 'pipelinesOrError' in json_res['data']
assert 'nodes' in json_res['data']['pipelinesOrError']
assert len(json_res['data']['pipelinesOrError']['nodes']) == n_pipelines
return res
def test_notebook_view():
notebook_path = script_relative_path('render_uuid_notebook.ipynb')
with create_app(
ExecutionTargetHandle.for_repo_yaml(script_relative_path('./repository.yaml')),
DagsterInstance.ephemeral(),
).test_client() as client:
res = client.get('/dagit/notebook?path={}'.format(notebook_path))
assert res.status_code == 200
# This magic guid is hardcoded in the notebook
assert b'6cac0c38-2c97-49ca-887c-4ac43f141213' in res.data