本文整理汇总了Python中networkapi.test.functions.valid_content函数的典型用法代码示例。如果您正苦于以下问题:Python valid_content函数的具体用法?Python valid_content怎么用?Python valid_content使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了valid_content函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_save_none
def test_save_none(self):
mock = self.mock_valid()
mock["nome"] = "InterfaceNone"
mock[self.KEY_ATTR] = self.NONE_ATTR
response = self.save({self.XML_KEY: mock})
valid_response(response)
valid_content(response, self.XML_KEY)
示例2: test_save_ipv4_valid
def test_save_ipv4_valid(self):
mock = self.mock_network_ip_valid()
mock[self.KEY_ATTR] = 26
response = self.client_autenticado().postXML(
self.URL_SAVE_NETWORK_IPV4, {self.XML_KEY_NETWORK_IP: mock})
valid_response(response)
valid_content(response, self.XML_KEY_NETWORK_IP)
示例3: test_save_ipv6_valid
def test_save_ipv6_valid(self):
mock = self.mock_network_hosts_ip_valid()
mock['id_vlan'] = 17
response = self.client_autenticado().putXML(
self.URL_SAVE_NETWORK_IPV6, {self.XML_KEY_NETWORK_IP: mock})
valid_response(response)
valid_content(response, self.XML_KEY_NETWORK_IP)
示例4: test_save_valid
def test_save_valid(self):
mock = self.mock_valid()
response = self.save({self.XML_KEY: mock})
valid_response(response)
content = valid_content(response, self.XML_KEY)
response = self.search(id_env_vip=content["id"])
valid_response(response)
env_vip = valid_content(response, self.XML_KEY)
self.valid_attr(mock, env_vip)
示例5: test_save_networkIpv6_set_first_available_ip_valid
def test_save_networkIpv6_set_first_available_ip_valid(self):
mock = self.mock_networkIpv6_set_first_available_ip_valid()
response = self.save({self.XML_KEY: mock})
valid_response(response)
response_dict = valid_content(response, self.XML_KEY)
response = self.client_autenticado().get(
self.URL_GET_IPS_BY_IPV6_ID % response_dict['id'])
valid_response(response)
valid_content(response, self.XML_KEY_IPS_NETWORK, True)
示例6: test_save_valid
def test_save_valid(self):
mock = self.mock_valid()
response = self.save({self.XML_KEY: mock})
valid_response(response)
group_user = valid_content(response, self.XML_KEY)
response = self.get_by_id(group_user['id'])
valid_response(response)
content = valid_content(response, self.XML_KEY)
self.valid_attr(mock, content)
示例7: test_associate_valid
def test_associate_valid(self):
response = self.client_autenticado().put(
self.URL_ASSOCIATE % (self.ID_VALID, self.ID_TYPE_EQUIPMENT))
valid_response(response)
valid_content(response, "equiptype_filter_xref")
# Remove filter association so it does not require cleaning db manually
response = self.client_autenticado().put(
self.URL_DISSOCIATE % (self.ID_VALID, self.ID_TYPE_EQUIPMENT))
valid_response(response)
示例8: test_save_valid
def test_save_valid(self):
mock = self.mock_valid()
response = self.save({self.XML_KEY: mock})
valid_response(response)
content = valid_content(response, self.XML_KEY)
response = self.get_by_id(content["id"])
valid_response(response)
ovip = valid_content(response, self.XML_KEY)
self.valid_attr(mock, ovip)
示例9: test_save_valid
def test_save_valid(self):
mock = self.mock_valid()
response = self.save({self.XML_KEY: mock})
valid_response(response)
content = valid_content(response, "perm")
response = self.get_by_id(content["id"])
valid_response(response)
perm = valid_content(response, "perm")
self.valid_attr(mock, perm)
示例10: test_save_networkIpv6AddResource_set_first_available_ip_valid
def test_save_networkIpv6AddResource_set_first_available_ip_valid(self):
mock = self.mock_networkIpv6AddResource_set_first_available_ip_valid()
response = self.client_autenticado().postXML(
self.URL_SAVE_NETWORK_IPV6, {self.XML_KEY_NETWORK_IP: mock})
valid_response(response)
response_dict = valid_content(response, self.XML_KEY_NETWORK_IP)
response = self.client_autenticado().get(
self.URL_GET_IPS_BY_IPV6_ID % response_dict['id_network'])
valid_response(response)
valid_content(response, self.XML_KEY_IPS_NETWORK, True)
示例11: test_associate_valid
def test_associate_valid(self):
response = self.client_autenticado().put(
self.URL_ASSOCIATE % (self.ID_OPTION_VIP_FOR_ASSOCIATION, self.ID_ENV_VIP_FOR_ASSOCIATION)
)
valid_response(response)
valid_content(response, "opcoesvip_ambiente_xref")
# Dissociate so it does not require cleaning db manually
response = self.client_autenticado().delete(
self.URL_DISSOCIATE % (self.ID_OPTION_VIP_FOR_ASSOCIATION, self.ID_ENV_VIP_FOR_ASSOCIATION)
)
valid_response(response)
示例12: test_save_valid
def test_save_valid(self):
mock = self.mock_valid()
response = self.save({self.XML_KEY: mock})
valid_response(response)
brand = valid_content(response, "brand")
response = self.get_all()
valid_response(response)
content = valid_content(response, "brand")
for brd in content:
if brd["id"] == brand["id"]:
self.valid_attr(mock, brd)
break
示例13: test_save_valid
def test_save_valid(self):
mock = self.mock_valid()
response = self.save({self.XML_KEY: mock})
valid_response(response)
script = valid_content(response, "script")
response = self.get_all()
valid_response(response)
content = valid_content(response, "script")
for scr in content:
if scr["id"] == script["id"]:
self.valid_attr(mock, scr)
break
示例14: test_save_valid
def test_save_valid(self):
mock = self.mock_valid()
response = self.save({self.XML_KEY: mock})
valid_response(response)
divisiondc = valid_content(response, "division_dc")
response = self.get_all()
valid_response(response)
content = valid_content(response, "division_dc")
for ddc in content:
if ddc["id"] == divisiondc["id"]:
self.valid_attr(mock, ddc)
break
示例15: test_save_valid
def test_save_valid(self):
mock = self.mock_valid()
response = self.save({self.XML_KEY: mock})
valid_response(response)
content = valid_content(response, "usuario")
response = self.get_by_id(content["id"])
valid_response(response)
user = valid_content(response, "usuario")
assert bool(user["ativo"]) == True
mock['password'] = hashlib.md5(mock['password']).hexdigest()
self.valid_attr(mock, user)