def test_casting_string_and_dict_will_return_rel_with_properties(self): type = "KNOWS" properties = {"since": 1999} casted = Rel.cast((type, properties)) assert casted == Rel(type, **properties)
def test_casting_rel_will_return_same(self): rel = Rel("KNOWS", since=1999) casted = Rel.cast(rel) assert casted is rel
def test_casting_string_will_return_rel_with_type(self): type = "KNOWS" casted = Rel.cast(type) assert casted == Rel(type)
def test_casting_none_will_return_none(self): casted = Rel.cast(None) assert casted is None