def test_equality(self): """Test presentation context equality""" pc_a = PresentationContext(1, '1.1.1', ['1.2.840.10008.1.2']) pc_b = PresentationContext(1, '1.1.1', ['1.2.840.10008.1.2']) self.assertTrue(pc_a == pc_a) self.assertTrue(pc_a == pc_b) self.assertFalse(pc_a != pc_b) self.assertFalse(pc_a != pc_a) pc_a.SCP = True self.assertFalse(pc_a == pc_b) pc_b.SCP = True self.assertTrue(pc_a == pc_b) pc_a.SCU = True self.assertFalse(pc_a == pc_b) pc_b.SCU = True self.assertTrue(pc_a == pc_b) self.assertFalse('a' == pc_b)
def test_string_output(self): """Test string output""" pc = PresentationContext(1, '1.1.1', ['1.2.840.10008.1.2']) pc.SCP = True pc.SCU = False pc.Result = 0x0002 self.assertTrue('1.1.1' in pc.__str__()) self.assertTrue('Implicit' in pc.__str__()) self.assertTrue('Provider Rejected' in pc.__str__())