Add another bunch of tests

This commit is contained in:
Lorenz Diener 2018-05-06 02:50:54 +02:00
pare f8e209f6ff
commit 4b00c448f4
S'han modificat 3 arxius amb 24 adicions i 1 eliminacions

Veure arxiu

@ -20,6 +20,22 @@ def test_constructor_illegal_ratelimit():
'foo', client_secret='bar',
ratelimit_method='baz')
def test_constructor_illegal_versioncheckmode():
with pytest.raises(MastodonIllegalArgumentError):
api = Mastodon(
'foo', client_secret='bar',
version_check_mode='baz')
def test_constructor_missing_client_secret():
with pytest.raises(MastodonIllegalArgumentError):
api = Mastodon('foo')
@pytest.mark.vcr()
def test_verify_version(api):
assert api.verify_minimum_version("2.3.3") == True
assert api.verify_minimum_version("2.3.4") == False
assert api.verify_minimum_version("2.4.3") == False
assert api.verify_minimum_version("3.3.3") == False
assert api.verify_minimum_version("1.0.0") == True

Veure arxiu

@ -29,3 +29,10 @@ def test_id_hook_within_reblog(api, status):
@pytest.mark.vcr()
def test_date_hook(status):
assert isinstance(status['created_at'], datetime)
@pytest.mark.vcr()
def test_attribute_access(status):
assert status.id != None
with pytest.raises(AttributeError):
status.id = 420

Veure arxiu

@ -11,7 +11,7 @@ def test_media_post(api, sensitive):
status = api.status_post(
'LOL check this out',
media_ids=[media],
media_ids=media,
sensitive=sensitive
)