Exemple #1
0
    def test_setting_expiration_to_bad_string_raises_value_error(
            self, username, roles, created, expiration, issued_by, token_id,
            bad_date_string):
        token = Token(cid=username,
                      r=roles,
                      cts=created,
                      ets=expiration,
                      rcid=issued_by,
                      tid=token_id)

        with pytest.raises(ValueError):
            token.expiration = bad_date_string
Exemple #2
0
    def test_setting_expiration_to_not_string_raises_type_error(
            self, username, roles, created, expiration, issued_by, token_id,
            not_string):
        token = Token(cid=username,
                      r=roles,
                      cts=created,
                      ets=expiration,
                      rcid=issued_by,
                      tid=token_id)

        with pytest.raises(TypeError):
            token.expiration = not_string