Esempio n. 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__
Esempio n. 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__
Esempio n. 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__
Esempio n. 4
0
 def empty(self):
     new_rule = Rule.empty(self)
     new_rule.gmg_controller = self.gmg_controller
     return new_rule
Esempio n. 5
0
 def empty(self):
     new_rule = Rule.empty(self)
     new_rule.gmg_controller = self.gmg_controller
     return new_rule