Пример #1
0
 def test_each_yielded_item_is_a_dictionary(self):
     result = scraper.extract_raw_data(generate_fake_rows())
     for a in result:
         self.assertTrue(type(a) is dict)
Пример #2
0
 def test_keys_for_dict_are_the_labels(self):
     row = scraper.extract_raw_data(generate_fake_rows()).next()
     expected = sorted(scraper.LABELS)
     actual = sorted(row.keys())
     self.assertEqual(expected, actual)
Пример #3
0
 def test_returns_a_generator(self):
     result = scraper.extract_raw_data(generate_fake_rows())
     self.assertTrue(type(result) is types.GeneratorType)