示例#1
0
def test_rule_emptying():
    """Rule emptying"""
    r = Rule("/foo", {"meh": "muh"}, "x", ["POST"], False, "x", True, None)
    r2 = r.empty()
    assert r.__dict__ == r2.__dict__
    r.methods.add("GET")
    assert r.__dict__ != r2.__dict__
    r.methods.discard("GET")
    r.defaults["meh"] = "aha"
    assert r.__dict__ != r2.__dict__
示例#2
0
def test_rule_emptying():
    """Rule emptying"""
    r = Rule('/foo', {'meh': 'muh'}, 'x', ['POST'], False, 'x', True, None)
    r2 = r.empty()
    assert r.__dict__ == r2.__dict__
    r.methods.add('GET')
    assert r.__dict__ != r2.__dict__
    r.methods.discard('GET')
    r.defaults['meh'] = 'aha'
    assert r.__dict__ != r2.__dict__
示例#3
0
def test_rule_emptying():
    """Rule emptying"""
    r = Rule('/foo', {'meh': 'muh'}, 'x', ['POST'],
             False, 'x', True, None)
    r2 = r.empty()
    assert r.__dict__ == r2.__dict__
    r.methods.add('GET')
    assert r.__dict__ != r2.__dict__
    r.methods.discard('GET')
    r.defaults['meh'] = 'aha'
    assert r.__dict__ != r2.__dict__
示例#4
0
 def empty(self):
     new_rule = Rule.empty(self)
     new_rule.gmg_controller = self.gmg_controller
     return new_rule
示例#5
0
 def empty(self):
     new_rule = Rule.empty(self)
     new_rule.gmg_controller = self.gmg_controller
     return new_rule