Update test_server.py

This commit is contained in:
Hellowlol 2020-04-16 23:41:11 +02:00
parent de52418cad
commit 562ac2dd75

View file

@ -132,24 +132,14 @@ def test_server_history(plex, movie):
movie.markUnwatched() movie.markUnwatched()
@pytest.mark.anonymously #@pytest.mark.anonymously
#@pytest.mark.authenticated
def test_server_Server_query(plex): def test_server_Server_query(plex):
assert plex.query('/') assert plex.query('/')
with pytest.raises(NotFound): with pytest.raises(NotFound):
assert plex.query('/asdf/1234/asdf', headers={'random_headers': '1234'}) assert plex.query('/asdf/1234/asdf', headers={'random_headers': '1234'})
@pytest.mark.authenticated
def test_server_Server_query_authenticated(plex):
assert plex.query('/')
with pytest.raises(BadRequest):
assert plex.query('/asdf/1234/asdf', headers={'random_headers': '1234'})
with pytest.raises(BadRequest):
# This is really requests.exceptions.HTTPError
# 401 Client Error: Unauthorized for url
PlexServer(utils.SERVER_BASEURL, '1234')
def test_server_Server_session(account): def test_server_Server_session(account):
# Mock Sesstion # Mock Sesstion
class MySession(Session): class MySession(Session):