コード例 #1
0
 def test__hash__(self):
     left_pr = frpa.FipPriority(10)
     right_pr = frpa.FipPriority(10)
     other_pr = frpa.FipPriority(20)
     self.assertEqual(hash(left_pr), hash(right_pr))
     self.assertNotEqual(hash(left_pr), hash(other_pr))
     self.assertNotEqual(hash(other_pr), hash(right_pr))
コード例 #2
0
 def test__eq__(self):
     left_pr = frpa.FipPriority(10)
     right_pr = frpa.FipPriority(10)
     other_pr = frpa.FipPriority(20)
     self.assertEqual(left_pr, right_pr)
     self.assertNotEqual(left_pr, other_pr)
     self.assertNotEqual(right_pr, other_pr)
コード例 #3
0
 def test__repr__(self):
     test_pr = frpa.FipPriority(20)
     self.assertEqual("20", str(test_pr))
コード例 #4
0
 def test__init__(self):
     test_pr = frpa.FipPriority(10)
     self.assertEqual(10, test_pr.index)