Differential D5928 Diff 29382 python_modules/dagster-graphql/dagster_graphql_tests/graphql/test_subset.py
Changeset View
Changeset View
Standalone View
Standalone View
python_modules/dagster-graphql/dagster_graphql_tests/graphql/test_subset.py
import re | import re | ||||
import sys | |||||
import pytest | |||||
from dagster_graphql.test.utils import execute_dagster_graphql, infer_pipeline_selector | from dagster_graphql.test.utils import execute_dagster_graphql, infer_pipeline_selector | ||||
from .graphql_context_test_suite import ReadonlyGraphQLContextTestMatrix | from .graphql_context_test_suite import ReadonlyGraphQLContextTestMatrix | ||||
SCHEMA_OR_ERROR_SUBSET_QUERY = """ | SCHEMA_OR_ERROR_SUBSET_QUERY = """ | ||||
query EnvironmentQuery($selector: PipelineSelector!){ | query EnvironmentQuery($selector: PipelineSelector!){ | ||||
runConfigSchemaOrError(selector: $selector) { | runConfigSchemaOrError(selector: $selector) { | ||||
__typename | __typename | ||||
▲ Show 20 Lines • Show All 43 Lines • ▼ Show 20 Lines | def test_csv_hello_world_pipeline_or_error_subset_wrong_solid_name(self, graphql_context): | ||||
graphql_context, SCHEMA_OR_ERROR_SUBSET_QUERY, {"selector": selector} | graphql_context, SCHEMA_OR_ERROR_SUBSET_QUERY, {"selector": selector} | ||||
) | ) | ||||
assert not result.errors | assert not result.errors | ||||
assert result.data | assert result.data | ||||
assert result.data["runConfigSchemaOrError"]["__typename"] == "InvalidSubsetError" | assert result.data["runConfigSchemaOrError"]["__typename"] == "InvalidSubsetError" | ||||
assert '"nope" does not exist' in result.data["runConfigSchemaOrError"]["message"] | assert '"nope" does not exist' in result.data["runConfigSchemaOrError"]["message"] | ||||
@pytest.mark.skipif(sys.version_info.major < 3, reason="Exception cause only available on py3+") | |||||
def test_pipeline_with_invalid_definition_error(self, graphql_context): | def test_pipeline_with_invalid_definition_error(self, graphql_context): | ||||
selector = infer_pipeline_selector( | selector = infer_pipeline_selector( | ||||
graphql_context, "pipeline_with_invalid_definition_error", ["fail_subset"] | graphql_context, "pipeline_with_invalid_definition_error", ["fail_subset"] | ||||
) | ) | ||||
result = execute_dagster_graphql( | result = execute_dagster_graphql( | ||||
graphql_context, SCHEMA_OR_ERROR_SUBSET_QUERY, {"selector": selector} | graphql_context, SCHEMA_OR_ERROR_SUBSET_QUERY, {"selector": selector} | ||||
) | ) | ||||
assert not result.errors | assert not result.errors | ||||
Show All 10 Lines |