Esempio n. 1
0
 def test_cmp(self):
     a = language.DisconnectAt(0)
     b = language.DisconnectAt(1)
     c = language.DisconnectAt(0)
     assert a < b
     assert a == c
     l = [b, a]
     l.sort()
     assert l[0].offset == 0
Esempio n. 2
0
 def test_spec(self):
     assert language.DisconnectAt("r").spec() == "dr"
     assert language.DisconnectAt(10).spec() == "d10"
Esempio n. 3
0
 def test_freeze(self):
     l = language.DisconnectAt(5)
     assert l.freeze({}).spec() == l.spec()
Esempio n. 4
0
 def test_repr(self):
     e = language.DisconnectAt("r")
     assert repr(e)
Esempio n. 5
0
 def test_resolve(self):
     r = language.parse_request({}, 'GET:"/foo"')
     e = language.DisconnectAt("r")
     ret = e.resolve(r, {})
     assert isinstance(ret.offset, int)