示例#1
0
    def test_token_with_no_expiry_is_valid(self):
        token = tokens.Token(
            mock.Mock(expires=None, userid='acct:[email protected]'))

        assert token.is_valid()
示例#2
0
    def test_token_with_past_expiry_is_not_valid(self):
        token = tokens.Token(
            mock.Mock(userid='acct:[email protected]',
                      expires=_seconds_from_now(-1800)))

        assert not token.is_valid()
示例#3
0
    def test_token_with_future_expiry_is_valid(self):
        token = tokens.Token(
            mock.Mock(userid="acct:[email protected]",
                      expires=_seconds_from_now(1800)))

        assert token.is_valid()