本文整理汇总了Python中urlobject.query_string.QueryString.del_param方法的典型用法代码示例。如果您正苦于以下问题:Python QueryString.del_param方法的具体用法?Python QueryString.del_param怎么用?Python QueryString.del_param使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类urlobject.query_string.QueryString
的用法示例。
在下文中一共展示了QueryString.del_param方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_del_param_can_remove_anonymous_parameters
# 需要导入模块: from urlobject.query_string import QueryString [as 别名]
# 或者: from urlobject.query_string.QueryString import del_param [as 别名]
def test_del_param_can_remove_anonymous_parameters(self):
s = QueryString(u'abc=123&=456&def=789')
assert s.del_param(u'') == u'abc=123&def=789'
示例2: test_del_param_can_remove_valueless_parameters
# 需要导入模块: from urlobject.query_string import QueryString [as 别名]
# 或者: from urlobject.query_string.QueryString import del_param [as 别名]
def test_del_param_can_remove_valueless_parameters(self):
valueless = QueryString(u'abc=123&def&abc=456')
empty_valued = QueryString(u'abc=123&def=&abc=456')
assert valueless.del_param(u'def') == u'abc=123&abc=456'
assert empty_valued.del_param(u'def') == u'abc=123&abc=456'
示例3: test_del_param_removes_all_instances_of_the_parameter_from_the_QueryString
# 需要导入模块: from urlobject.query_string import QueryString [as 别名]
# 或者: from urlobject.query_string.QueryString import del_param [as 别名]
def test_del_param_removes_all_instances_of_the_parameter_from_the_QueryString(self):
s = QueryString(u'abc=123&def=456&abc=789')
assert s.del_param(u'abc') == u'def=456'
assert s.del_param(u'def') == u'abc=123&abc=789'
示例4: test_del_param_removes_all_instances_of_the_parameter_from_the_QueryString
# 需要导入模块: from urlobject.query_string import QueryString [as 别名]
# 或者: from urlobject.query_string.QueryString import del_param [as 别名]
def test_del_param_removes_all_instances_of_the_parameter_from_the_QueryString(self):
s = QueryString("abc=123&def=456&abc=789")
assert s.del_param("abc") == "def=456"
assert s.del_param("def") == "abc=123&abc=789"
示例5: test_del_param_can_remove_anonymous_parameters
# 需要导入模块: from urlobject.query_string import QueryString [as 别名]
# 或者: from urlobject.query_string.QueryString import del_param [as 别名]
def test_del_param_can_remove_anonymous_parameters(self):
s = QueryString("abc=123&=456&def=789")
assert s.del_param("") == "abc=123&def=789"
示例6: test_del_param_can_remove_valueless_parameters
# 需要导入模块: from urlobject.query_string import QueryString [as 别名]
# 或者: from urlobject.query_string.QueryString import del_param [as 别名]
def test_del_param_can_remove_valueless_parameters(self):
valueless = QueryString("abc=123&def&abc=456")
empty_valued = QueryString("abc=123&def=&abc=456")
assert valueless.del_param("def") == "abc=123&abc=456"
assert empty_valued.del_param("def") == "abc=123&abc=456"