Пример #1
0
 def test_equality(self):
     m1 = PoisonMessage(1)
     assert m1 == PoisonMessage(1)
     m2 = PoisonMessage('hi')
     assert m2 == PoisonMessage('hi')
Пример #2
0
 def test_properties(self):
     assert 1 == PoisonMessage(1).poisonMessage
     assert PoisonMessage(None).poisonMessage is None
     assert 'foo' == PoisonMessage('foo').poisonMessage
Пример #3
0
 def test_inheritance(self):
     assert isinstance(PoisonMessage(1), PoisonMessage)
     assert isinstance(PoisonMessage('hi'), PoisonMessage)
     assert isinstance(PoisonMessage(1), ActorSystemMessage)
     assert isinstance(PoisonMessage('hi'), ActorSystemMessage)
Пример #4
0
 def test_inequality(self):
     m1 = PoisonMessage(1)
     assert m1 != 1
     assert m1 != PoisonMessage('hi')
     assert m1 != PoisonMessage(0)
     assert m1 != PoisonMessage(None)
Пример #5
0
 def test_equality(self):
     m1 = PoisonMessage(1)
     self.assertEqual(m1, PoisonMessage(1))
     m2 = PoisonMessage('hi')
     self.assertEqual(m2, PoisonMessage('hi'))
Пример #6
0
 def test_inheritance(self):
     self.assertTrue(isinstance(PoisonMessage(1), PoisonMessage))
     self.assertTrue(isinstance(PoisonMessage('hi'), PoisonMessage))
     self.assertTrue(isinstance(PoisonMessage(1), ActorSystemMessage))
     self.assertTrue(isinstance(PoisonMessage('hi'), ActorSystemMessage))
Пример #7
0
 def test_properties(self):
     self.assertEqual(1, PoisonMessage(1).poisonMessage)
     self.assertEqual(None, PoisonMessage(None).poisonMessage)
     self.assertEqual('foo', PoisonMessage('foo').poisonMessage)
Пример #8
0
 def test_inequality(self):
     m1 = PoisonMessage(1)
     self.assertNotEqual(m1, 1)
     self.assertNotEqual(m1, PoisonMessage('hi'))
     self.assertNotEqual(m1, PoisonMessage(0))
     self.assertNotEqual(m1, PoisonMessage(None))