def test_from_invalid_json(): with pytest.raises(InvalidDatalakeMetadata): Metadata.from_json('{flee floo')
def test_from_none_json(): with pytest.raises(InvalidDatalakeMetadata): Metadata.from_json(None)
def test_from_to_json(basic_metadata): m1 = Metadata.from_json(basic_json) m2 = m1.json assert sorted(m2) == sorted(basic_json)