Esempio n. 1
0
def test_json_field_parser():
    json_property = Property.parse_raw(
        '{"obj": "properties.Property", "name": "users.additional_data ->> title", "alias": "title"}'
    )
    assert json_property.name == "users.additional_data ->> title"
    assert str(
        json_property) == "users.additional_data ->> 'title' AS \"title\""
Esempio n. 2
0
def test_json_nested_field_parser():
    json_property = Property.parse_raw(
        '{"obj": "properties.Property", "name": "users.additional_data -> custom_fields ->> age", "alias": "age"}'
    )
    assert json_property.name == "users.additional_data -> custom_fields ->> age"
    assert str(
        json_property
    ) == "users.additional_data -> 'custom_fields' ->> 'age' AS \"age\""
Esempio n. 3
0
def test_json_serialize(valid_instance: Property):
    assert valid_instance == Property.parse_raw(
        '{"obj": "properties.Property", "name": "users.name", "alias": "name"}'
    )