コード例 #1
0
ファイル: test_utils.py プロジェクト: adipriyantobpn/moirai
 def test_empty_left(self):
     with pytest.raises(Exception) as ex:
         utils.parse_associations('-> a')
     assert str(ex.value) == "Empty member"
コード例 #2
0
ファイル: test_utils.py プロジェクト: adipriyantobpn/moirai
 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"
コード例 #3
0
ファイル: test_utils.py プロジェクト: adipriyantobpn/moirai
 def test_morelines(self):
     assert utils.parse_associations('a -> b\nc -> d\n') == [('a', 'b'), ('c', 'd')]
コード例 #4
0
ファイル: test_utils.py プロジェクト: adipriyantobpn/moirai
 def test_no_association(self):
     with pytest.raises(Exception) as ex:
         utils.parse_associations('a')
     assert str(ex.value) == "Invalid number of members"
コード例 #5
0
ファイル: test_utils.py プロジェクト: adipriyantobpn/moirai
 def test_oneline(self):
     assert utils.parse_associations('a -> b') == [('a','b')]