def test_g_agrega_ip_a_red_existente(self): data = {"dns1": "5.5.5.5", "dns2": "5.5.5.5", "nombre": "test"} data2 = { "dns1": "10.10.10.10", "dns2": "10.10.10.10", "nombre": "test" } self.assertEqual(IPContainer.addIPtoNetwork("test_user1", "dns", data), True, "IP agregada 1 a la red existente correctamente") self.assertEqual( IPContainer.addIPtoNetwork("test_user1", "dns", data2), True, "IP agregada 2 a la red existente correctamente")
def addIPtoNetwork(current_user, user, _type): js = request.get_json() return jsonify( success=IPContainer.addIPtoNetwork(str(user), str(_type), js['data']))