本文整理汇总了Python中w3af.core.data.dc.generic.kv_container.KeyValueContainer.set_token方法的典型用法代码示例。如果您正苦于以下问题:Python KeyValueContainer.set_token方法的具体用法?Python KeyValueContainer.set_token怎么用?Python KeyValueContainer.set_token使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类w3af.core.data.dc.generic.kv_container.KeyValueContainer
的用法示例。
在下文中一共展示了KeyValueContainer.set_token方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_get_short_printable_repr_unicode_value_unicode
# 需要导入模块: from w3af.core.data.dc.generic.kv_container import KeyValueContainer [as 别名]
# 或者: from w3af.core.data.dc.generic.kv_container.KeyValueContainer import set_token [as 别名]
def test_get_short_printable_repr_unicode_value_unicode(self):
dc = KeyValueContainer([(u'aéb', [u'céd']), (u'b', ['2', '3'])])
dc.MAX_PRINTABLE = 7
token = DataToken(u'aéb', u'céd', (u'aéb', 0))
dc.set_token(token)
self.assertEqual(dc.get_short_printable_repr(), '...a.b=c.d...')
示例2: test_double_data_token_wrap
# 需要导入模块: from w3af.core.data.dc.generic.kv_container import KeyValueContainer [as 别名]
# 或者: from w3af.core.data.dc.generic.kv_container.KeyValueContainer import set_token [as 别名]
def test_double_data_token_wrap(self):
dc = KeyValueContainer([(u'a', ['1']), (u'b', ['c', '3'])])
dc.set_token(('b', 1))
for dcc, token in dc.iter_bound_tokens():
self.assertIsInstance(token, DataToken)
self.assertIsInstance(token.get_value(), basestring)
示例3: test_get_short_printable_repr_unicode_value
# 需要导入模块: from w3af.core.data.dc.generic.kv_container import KeyValueContainer [as 别名]
# 或者: from w3af.core.data.dc.generic.kv_container.KeyValueContainer import set_token [as 别名]
def test_get_short_printable_repr_unicode_value(self):
dc = KeyValueContainer([(u'a', ['x']), (u'b', ['2', '3'])])
dc.MAX_PRINTABLE = 5
token = DataToken('a', 'é', ('a', 0))
dc.set_token(token)
self.assertEqual(dc.get_short_printable_repr(), '...a=....')
示例4: test_get_short_printable_repr_token_obj
# 需要导入模块: from w3af.core.data.dc.generic.kv_container import KeyValueContainer [as 别名]
# 或者: from w3af.core.data.dc.generic.kv_container.KeyValueContainer import set_token [as 别名]
def test_get_short_printable_repr_token_obj(self):
dc = KeyValueContainer([(u'a', ['1']), (u'b', ['2', '3'])])
token = DataToken('a', '1', ('a', 0))
dc.set_token(token)
self.assertIsNotNone(dc.get_token())
self.assertEqual(dc.get_short_printable_repr(), 'a=1&b=2&b=3')
示例5: test_get_short_printable_repr_token_obj_reduce_printable
# 需要导入模块: from w3af.core.data.dc.generic.kv_container import KeyValueContainer [as 别名]
# 或者: from w3af.core.data.dc.generic.kv_container.KeyValueContainer import set_token [as 别名]
def test_get_short_printable_repr_token_obj_reduce_printable(self):
dc = KeyValueContainer([(u'a', ['1']), (u'b', ['2', '3'])])
dc.MAX_PRINTABLE = 5
token = DataToken('a', '1', ('a', 0))
dc.set_token(token)
self.assertIsNotNone(dc.get_token())
self.assertEqual(dc.get_short_printable_repr(), '...a=1...')
示例6: test_copy_with_token
# 需要导入模块: from w3af.core.data.dc.generic.kv_container import KeyValueContainer [as 别名]
# 或者: from w3af.core.data.dc.generic.kv_container.KeyValueContainer import set_token [as 别名]
def test_copy_with_token(self):
dc = KeyValueContainer([(u'a', ['1']), (u'b', ['2', '3'])])
dc.set_token(('a', 0))
dc_copy = copy.deepcopy(dc)
self.assertEqual(dc.get_token(), dc_copy.get_token())
self.assertIsNotNone(dc.get_token())
self.assertIsNotNone(dc_copy.get_token())
示例7: test_set_token_using_data_token
# 需要导入模块: from w3af.core.data.dc.generic.kv_container import KeyValueContainer [as 别名]
# 或者: from w3af.core.data.dc.generic.kv_container.KeyValueContainer import set_token [as 别名]
def test_set_token_using_data_token(self):
dc = KeyValueContainer([(u'a', ['1']), (u'b', ['2', '3'])])
token = DataToken('a', '1', ('a', 0))
set_token = dc.set_token(token)
self.assertEqual(dc.get_token().get_name(), 'a')
self.assertEqual(dc.get_token().get_value(), '1')
self.assertEqual(dc.get_token().get_path(), ('a', 0))
self.assertIs(dc.get_token(), token)
self.assertIs(set_token, token)
示例8: test_double_data_token_wrap_set_set
# 需要导入模块: from w3af.core.data.dc.generic.kv_container import KeyValueContainer [as 别名]
# 或者: from w3af.core.data.dc.generic.kv_container.KeyValueContainer import set_token [as 别名]
def test_double_data_token_wrap_set_set(self):
dc = KeyValueContainer([(u'a', ['1']), (u'b', ['c', '3'])])
token_1 = dc.set_token(('b', 1))
token_2 = dc.set_token(('b', 1))
self.assertIs(token_1, token_2)
示例9: test_set_token
# 需要导入模块: from w3af.core.data.dc.generic.kv_container import KeyValueContainer [as 别名]
# 或者: from w3af.core.data.dc.generic.kv_container.KeyValueContainer import set_token [as 别名]
def test_set_token(self):
dc = KeyValueContainer([(u'a', ['1']), (u'b', ['2', '3'])])
token = dc.set_token(('a', 0))
self.assertEqual(token.get_name(), 'a')
self.assertEqual(token, dc['a'][0])
示例10: test_get_short_printable_repr
# 需要导入模块: from w3af.core.data.dc.generic.kv_container import KeyValueContainer [as 别名]
# 或者: from w3af.core.data.dc.generic.kv_container.KeyValueContainer import set_token [as 别名]
def test_get_short_printable_repr(self):
dc = KeyValueContainer([(u'a', ['1']), (u'b', ['2', '3'])])
dc.set_token(('a', 0))
self.assertEqual(dc.get_short_printable_repr(), 'a=1&b=2&b=3')