Add another bunch of tests
This commit is contained in:
pare
f8e209f6ff
commit
4b00c448f4
S'han modificat 3 arxius amb 24 adicions i 1 eliminacions
|
@ -20,6 +20,22 @@ def test_constructor_illegal_ratelimit():
|
||||||
'foo', client_secret='bar',
|
'foo', client_secret='bar',
|
||||||
ratelimit_method='baz')
|
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():
|
def test_constructor_missing_client_secret():
|
||||||
with pytest.raises(MastodonIllegalArgumentError):
|
with pytest.raises(MastodonIllegalArgumentError):
|
||||||
api = Mastodon('foo')
|
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
|
||||||
|
|
|
@ -29,3 +29,10 @@ def test_id_hook_within_reblog(api, status):
|
||||||
@pytest.mark.vcr()
|
@pytest.mark.vcr()
|
||||||
def test_date_hook(status):
|
def test_date_hook(status):
|
||||||
assert isinstance(status['created_at'], datetime)
|
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
|
||||||
|
|
|
@ -11,7 +11,7 @@ def test_media_post(api, sensitive):
|
||||||
|
|
||||||
status = api.status_post(
|
status = api.status_post(
|
||||||
'LOL check this out',
|
'LOL check this out',
|
||||||
media_ids=[media],
|
media_ids=media,
|
||||||
sensitive=sensitive
|
sensitive=sensitive
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
Loading…
Referencia en una nova incidència