예제 #1
0
 def test_in_false(self):
     vs = VectorSet(self.parent_node)
     self.assertEqual(self.vP1 in vs, False)
예제 #2
0
 def test_remove_failure(self):
     vs = VectorSet(self.parent_node)
     self.assertEqual(vs.remove(self.vP1), False)
예제 #3
0
 def test_in_true(self):
     vs = VectorSet(self.parent_node)
     vs.add(self.vP1)
     self.assertEqual(self.vP1 in vs, True)
예제 #4
0
 def test_remove_succeed(self):
     vs = VectorSet(self.parent_node)
     vs.add(self.vP1)
     self.assertEqual(vs.remove(self.vP1), True)
예제 #5
0
 def test_len_same_after_failed_add(self):
     vs = VectorSet(self.parent_node)
     vs.add(self.vP1)
     length = len(vs)
     vs.add(self.vP1)
     self.assertEqual(len(vs), length)
예제 #6
0
 def test_add_repeat_vector(self):
     vs = VectorSet(self.parent_node)
     vs.add(self.vP1)
     self.assertEqual(vs.add(self.vP1), False)
예제 #7
0
 def test_add(self):
     vs = VectorSet(self.parent_node)
     try:
         vs.add(self.vP1)
     except ValueError as ve:
         self.fail(ve.args)
예제 #8
0
 def test_len_0(self):
     vs = VectorSet(self.parent_node)
     self.assertEqual(len(vs), 0)