def testAdd(self): jls = Jails() j = jls.create(getJail()) jls.add(j) self.assertEqual(1, jls.count()) self.assertRaises(KeyError, jls.add, j)
def testLoad(self): ''' Jails.load() will load a json-serialized jail list and add them to it's registry ''' jls = Jails() jails = [] for i in range(10): jails.append(getJail()) jls.load(jails) self.assertEqual(jls.count(), 10, "The number of imported jails does not match generated count")
def testClear(self): jls = Jails() jls.add(jls.create(getJail())) jls.clear() self.assertEqual(0, jls.count(), "Jails list not cleared.")