def test_l_comprobar_numero_redes(self): self.assertEqual(IPContainer.getNumberOfNetworks(), 1, "1 - Numero de redes correcto. (1)") IPContainer.createNetwork("test_user3", "wlan") self.assertEqual(IPContainer.getNumberOfNetworks(), 2, "2 - Numero de redes correcto. (2)")
def test_e_crea_red(self): IPContainer.createNetwork("test_user1", "dns") self.assertEqual(IPContainer.existNetwork("test_user1", "dns"), True, "Nueva red creada correctamente")
def test_f_crea_red_que_ya_existe(self): self.assertEqual(IPContainer.createNetwork("test_user1", "dns"), False, "Red existente no creada")
def createNetwork(current_user, user, _type): return jsonify(success=IPContainer.createNetwork(str(user), str(_type)))