예제 #1
0
 def test_003_NotAList(self):
     """ transListToGraphTest_003: Tests cases where input is a Graph or a String  """
     # Result Graph has keys == values
     self.assertEqual(xayacore.transListToGraph(self.agraph), {'two': ['two'], 'one': ['one']})
     # Result Graph has keys == unique charachters in string
     self.assertEqual(xayacore.transListToGraph(self.astring), {'a': ['a'], ' ': [' '], 'g': ['g'], 'i': ['i'],
                                                                    'h': ['h'], 'n': ['n'], 's': ['s'], 'r': ['r'], 't': ['t']})
예제 #2
0
 def test_002_EmptyList(self):
     """ transListToGraphTest_002_EmptyList: Tests case where input is an empty list == NoInputParams """
     self.assertEqual(xayacore.transListToGraph(), {})
예제 #3
0
 def test_001_NormalCase(self):
     """ transListToGraphTest_001_NormalCase: Tests examples of normal list input """
     self.assertEqual(xayacore.transListToGraph(self.alist), {'1': [1], '3': [3], '2': [2], '4': [4]})
     self.assertEqual(xayacore.transListToGraph(self.morecomplexlist), {'1': [1], '[1, 2, 3]': [[1, 2, 3]],
                                                                       'two': ['two'], "('a', 'b', 'c')": [('a', 'b', 'c')],
                                                                       "{1: 'one', 'akey': 'avalue'}": [{1: 'one', 'akey': 'avalue'}]})