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
def test_spec(self): assert language.DisconnectAt("r").spec() == "dr" assert language.DisconnectAt(10).spec() == "d10"
def test_freeze(self): l = language.DisconnectAt(5) assert l.freeze({}).spec() == l.spec()
def test_repr(self): e = language.DisconnectAt("r") assert repr(e)
def test_resolve(self): r = language.parse_request({}, 'GET:"/foo"') e = language.DisconnectAt("r") ret = e.resolve(r, {}) assert isinstance(ret.offset, int)