Пример #1
0
 def get_additional_sightings_count(duplicates):
     count = 0
     for dup in duplicates:
         api_object = EdgeObject.load(dup).to_ApiObject()
         count += _get_sighting_count(api_object.obj)
     return count
 def test_get_sighting_count_set_to_none(self):
     obs = Observable()
     obs.sighting_count = None
     actual = _get_sighting_count(obs)
     self.assertEqual(actual, 1)
 def test_get_sighting_count_set_to_two(self):
     obs = Observable()
     obs.sighting_count = 2
     actual = _get_sighting_count(obs)
     self.assertEqual(actual, 2)
 def test_get_sighting_count_not_set(self):
     obs = Observable()
     actual = _get_sighting_count(obs)
     self.assertEqual(actual, 1)