Beispiel #1
0
 def test_002_EmptyGraph(self):
     """ shelveGraphTest_002_EmptyGraph: Tests the case  EmptyGraph of an emptygraph being shelved to a default location"""
     self.assertEqual(xayacore.shelveGraph(),{})
     os.remove('defaultFilePath') # tears down shelf file created in this test
Beispiel #2
0
 def test_004_StringVsInteger(self):
     """ shelveGraphTest_004_StringVsInteger: Tests case StringVsInteger -- that strings as keys work, integers as keys fail """
     self.assertEqual(xayacore.shelveGraph({'1':'one', '2': 'two'}),{'1':'one', '2': 'two'})
     os.remove('defaultFilePath') # tears down shelf file created in this test
     self.assertRaises(TypeError, xayacore.shelveGraph,{1:'one', 2: 'two'})
     os.remove('defaultFilePath')
Beispiel #3
0
 def test_001_NormalCase(self):
     """ shelveGraphTest_001_NormalCase: Tests the NormalCase of the graph read into shelf being returned by shelf"""
     self.assertEqual(xayacore.shelveGraph(self.graph_shelveGraph, 'shelvegraphtestfile'),self.graph_shelveGraph)
     os.remove('shelvegraphtestfile') # tears down shelf file created in this test