Example #1
0
 def test_compare_apple_and_oranges(self):
     activity = AggregatedActivity(1, [Activity(1, LoveVerb, Pin(id=1))])
     with self.assertRaises(ValueError):
         activity == Pin(id=1)
Example #2
0
 def test_contains_extraneous_object(self):
     activity = AggregatedActivity(1, [Activity(1, LoveVerb, Pin(id=1))])
     with self.assertRaises(ValueError):
         activity.contains(Pin(id=1))
Example #3
0
 def test_duplicated_activities(self):
     activity = Activity(1, LoveVerb, Pin(id=1))
     aggregated = AggregatedActivity(1, [activity])
     with self.assertRaises(DuplicateActivityException):
         aggregated.append(activity)
Example #4
0
 def test_contains(self):
     activity = Activity(1, LoveVerb, Pin(id=1))
     aggregated = AggregatedActivity(1, [activity])
     self.assertTrue(aggregated.contains(activity))
Example #5
0
 def test_contains_extraneous_object(self):
     activity = AggregatedActivity(1, [Activity(1, LoveVerb, Pin(id=1))])
     with self.assertRaises(ValueError):
         activity.contains(Pin(id=1))
Example #6
0
 def test_duplicated_activities(self):
     activity = Activity(1, LoveVerb, Pin(id=1))
     aggregated = AggregatedActivity(1, [activity])
     with self.assertRaises(DuplicateActivityException):
         aggregated.append(activity)
Example #7
0
 def test_contains(self):
     activity = Activity(1, LoveVerb, Pin(id=1))
     aggregated = AggregatedActivity(1, [activity])
     self.assertTrue(aggregated.contains(activity))