Exemplo n.º 1
0
 def test_has(self):
     group = NetworkGroup()
     addresses = list()
     addresses.append(self.address01)
     addresses.append(self.address02)
     addresses.append(self.address03)
     for index, address in enumerate(addresses):
         for added in addresses[:index]:
             assert_true(group.has(added))
         for not_added in addresses[index:]:
             assert_false(group.has(not_added))
         group.add(address)
Exemplo n.º 2
0
 def test_remove(self):
     group = NetworkGroup()
     group.add(self.address01)
     assert_false(group.remove(self.address02))
     group.add(self.address02)
     assert_true(group.remove(self.address01))
     assert_true(group.remove(self.address02))
     assert_false(group.remove(self.address01))
     assert_false(group.has(self.address01))
     assert_false(group.has(self.address02))