Esempio n. 1
0
 def test_empty_left(self):
     with pytest.raises(Exception) as ex:
         utils.parse_associations('-> a')
     assert str(ex.value) == "Empty member"
Esempio n. 2
0
 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"
Esempio n. 3
0
 def test_morelines(self):
     assert utils.parse_associations('a -> b\nc -> d\n') == [('a', 'b'), ('c', 'd')]
Esempio n. 4
0
 def test_no_association(self):
     with pytest.raises(Exception) as ex:
         utils.parse_associations('a')
     assert str(ex.value) == "Invalid number of members"
Esempio n. 5
0
 def test_oneline(self):
     assert utils.parse_associations('a -> b') == [('a','b')]