Exemplo n.º 1
0
 def test_from_file_csv(self):
     csv_file = "./fixtures/HeatherPiwowar_070814.csv"
     ImpactStory.from_file(csv_file)
     self.assertTrue("File type is not JSON")
Exemplo n.º 2
0
 def test_from_file_json(self):
     json_file = "./fixtures/HeatherPiwowar_070914.json"
     impact_story_obj = ImpactStory.from_file(json_file)
     self.assertIsInstance(impact_story_obj, ImpactStory)
Exemplo n.º 3
0
 def test_from_file_corrupted(self):
     corrupted_json = "./fixtures/Corrupted_JSON.json"
     with self.assertRaises(ImpactStoryParseException) as cm:
         ImpactStory.from_file(corrupted_json)
     exception = cm.exception
     self.failUnlessRaises(exception)
Exemplo n.º 4
0
 def setUp(self):
     self.heather = ImpactStory.from_id("Heather Piwowar")
     self.saman = ImpactStory.from_file("./fixtures/SamanEhsan_070814.json")
     self.brian = ImpactStory.from_id("Brian Nosek")