def test_empty_left(self): with pytest.raises(Exception) as ex: utils.parse_associations('-> a') assert str(ex.value) == "Empty member"
def test_too_many_associations(self): with pytest.raises(Exception) as ex: utils.parse_associations('a -> b -> c') assert str(ex.value) == "Invalid number of members"
def test_morelines(self): assert utils.parse_associations('a -> b\nc -> d\n') == [('a', 'b'), ('c', 'd')]
def test_no_association(self): with pytest.raises(Exception) as ex: utils.parse_associations('a') assert str(ex.value) == "Invalid number of members"
def test_oneline(self): assert utils.parse_associations('a -> b') == [('a','b')]