Пример #1
0
    def __getitem__(self, key):
        next_ctx = None

        try:
            user_id = encoded_userid_to_userid(key)
        except ValueError:
            raise KeyError(key)

        next_ctx = UserResource(self, user_id)
        return next_ctx
Пример #2
0
def test_invalid_encoded_userid_raises_valueerror():
    from paildocket.models import encoded_userid_to_userid
    with pytest.raises(ValueError):
        encoded_userid_to_userid('1')
Пример #3
0
def test_encoded_userid_to_userid_no_padding():
    from paildocket.models import encoded_userid_to_userid
    assert encoded_userid_to_userid(ENCODED_USERID) == UUID_USERID