Ejemplo n.º 1
0
def test_scalar():
    with safe_tempfile_path() as tempfile_path:
        assert (
            read_value(
                resolve_dagster_type(String),
                write_value(resolve_dagster_type(String), "foo", tempfile_path),
            )
            == "foo"
        )
Ejemplo n.º 2
0
def test_custom_dagster_type():
    with safe_tempfile_path() as tempfile_path:
        assert (
            read_value(
                resolve_dagster_type(EvenType),
                write_value(resolve_dagster_type(EvenType), 4, tempfile_path),
            )
            == 4
        )
Ejemplo n.º 3
0
def test_scalar_any():
    with safe_tempfile_path() as tempfile_path:
        assert (
            read_value(
                resolve_dagster_type(Any),
                write_value(resolve_dagster_type(Any), 'foo', tempfile_path),
            )
            == 'foo'
        )
Ejemplo n.º 4
0
def test_read_bad_value():
    with pytest.raises(CheckError, match="Malformed value"):
        read_value(resolve_dagster_type(Any), {"value": "foo", "file": "bar"})
    with pytest.raises(CheckError, match="Malformed value"):
        read_value(resolve_dagster_type(Any), {"quux": "buzz"})
Ejemplo n.º 5
0
def test_read_bad_value():
    with pytest.raises(CheckError, match='Malformed value'):
        read_value(resolve_dagster_type(Any), {'value': 'foo', 'file': 'bar'})
    with pytest.raises(CheckError, match='Malformed value'):
        read_value(resolve_dagster_type(Any), {'quux': 'buzz'})