本文整理汇总了Python中networkapi.test.functions.string_generator函数的典型用法代码示例。如果您正苦于以下问题:Python string_generator函数的具体用法?Python string_generator怎么用?Python string_generator使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了string_generator函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_authenticate_wrong_password
def test_authenticate_wrong_password(self):
mock = self.user_login_valid()
mock['password'] = string_generator(10)
response = self.client_autenticado().postXML(
self.URL_AUTHENTICATE, {self.XML_KEY: mock})
valid_response(response)
assert xml2dict(response.content) == None
示例2: test_change_pass_maxsize
def test_change_pass_maxsize(self):
data = self.user_change_pass_valid()
data['password'] = string_generator(46)
response = self.client_autenticado().postXML(
self.URL_CHANGE_PASS, {self.XML_KEY: data})
valid_response(response, status_code=httplib.INTERNAL_SERVER_ERROR)
self._attr_invalid(response)
示例3: mock_for_disconnect
def mock_for_disconnect(self):
mock = {}
mock['nome'] = string_generator(10)
mock['descricao'] = 'mock'
mock['protegida'] = '0'
mock["id_ligacao_front"] = self.ID_DISCONNECT_VALID
return mock
示例4: test_save_invalid
def test_save_invalid(self):
mock = self.mock_network_valid()
mock[self.KEY_ATTR] = string_generator(10)
self.process_save_attr_invalid(mock)
示例5: test_alter_minsize
def test_alter_minsize(self):
mock = self.mock_valid()
mock[self.KEY_ATTR] = string_generator(2)
self.process_alter_attr_invalid(self.ID_ALTER_VALID, mock)
示例6: test_get_by_equip_name_invalid
def test_get_by_equip_name_invalid(self):
data = self.dict_for_get_by_equip_name(string_generator(25))
response = self.client_autenticado().postXML(
self.URL_GET_BY_EQUIP_NAME, data)
self._not_found(response, CodeError.EQUIPMENT_NOT_FOUND)
示例7: test_update_max_length
def test_update_max_length(self):
self.alter_attr_invalid(string_generator(self.NAME_MAX_LENGTH + 1))
示例8: test_save_max_length
def test_save_max_length(self):
mock = self.mock_valid()
mock[self.KEY_ATTR] = string_generator(self.NAME_MAX_LENGTH + 1)
self.process_save_attr_invalid(mock)
示例9: test_save_maxsize
def test_save_maxsize(self):
mock = self.mock_environment_ip_config_valid()
mock[self.KEY_ATTR] = string_generator(201)
response = self.client_autenticado().postXML(
self.URL_SAVE_ENVIRONMENT_IPCONFIG, {self.XML_KEY: mock})
self._attr_invalid(response)
示例10: test_alter_empty
def test_alter_empty(self):
mock = self.mock_valid()
mock["name"] = string_generator(5)
mock[self.KEY_ATTR] = self.EMPTY_ATTR
response = self.alter(self.ID_ALTER_VALID, {self.XML_KEY: mock})
self._attr_invalid(response)
示例11: test_alter_none
def test_alter_none(self):
mock = self.mock_valid()
mock["nome"] = string_generator(5)
mock[self.KEY_ATTR] = self.NONE_ATTR
response = self.alter(self.ID_ALTER_VALID, {self.XML_KEY: mock})
valid_response(response)
示例12: test_alter_minsize
def test_alter_minsize(self):
mock = self.mock_valid()
mock[self.KEY_ATTR] = string_generator(2)
response = self.save({self.XML_KEY: mock})
valid_response(response)
示例13: test_list_conns_old_interface_minsize
def test_list_conns_old_interface_minsize(self):
response = self.client_autenticado().get(
self.URL_LIST_CONNECTIONS_OLD % (string_generator(2), self.EQUIP_FOR_LIST))
valid_response(response, httplib.INTERNAL_SERVER_ERROR)
assert_response_error(response, CodeError.INTERFACE_NOT_FOUND)
示例14: test_list_conns_old_interface_maxsize
def test_list_conns_old_interface_maxsize(self):
response = self.client_autenticado().get(
self.URL_LIST_CONNECTIONS_OLD % (string_generator(21), self.EQUIP_FOR_LIST))
self._attr_invalid(response)
示例15: test_save_expect_string_maxsize
def test_save_expect_string_maxsize(self):
mock = self.mock_valid()
mock[self.KEY_ATTR] = string_generator(51)
response = self.client_autenticado().postXML(
self.URL_SAVE_EXPECT_STRING, {self.XML_KEY: mock})
self._attr_invalid(response)