示例#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)
示例#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))
示例#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)
示例#4
0
 def test_contains(self):
     activity = Activity(1, LoveVerb, Pin(id=1))
     aggregated = AggregatedActivity(1, [activity])
     self.assertTrue(aggregated.contains(activity))
示例#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))
示例#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)
示例#7
0
 def test_contains(self):
     activity = Activity(1, LoveVerb, Pin(id=1))
     aggregated = AggregatedActivity(1, [activity])
     self.assertTrue(aggregated.contains(activity))