Skip to content

Commit

Permalink
Make sure staleness tests errors in _any_ way (#52)
Browse files Browse the repository at this point in the history
 * Locally it might fail differently, if you have good config, so take care of this
 * But don't be too prescriptive on _what_ failure this is.
  • Loading branch information
declension committed May 29, 2018
1 parent c1dbbb7 commit 5400651
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion tests/integration_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

import pytest

import squeezealexa
from squeezealexa.squeezebox.server import Server
from squeezealexa.main import SqueezeAlexa
from squeezealexa.transport.base import Error as TransportError
Expand Down Expand Up @@ -71,9 +72,12 @@ def test_staleness_gets_new_server(self):
self.alexa.get_server()
assert self.alexa._server
self.stub._created_time = time.time() - 100000
# Hack that global
squeezealexa.main.SERVER_HOSTNAME = "not.there"
with pytest.raises(TransportError) as e:
self.alexa.get_server()
assert "nothing listening" in str(e)
# *Something* will go wrong, as there's no config and/or no server
assert str(e)

def test_on_pause_resume(self):
intent = {}
Expand Down

0 comments on commit 5400651

Please sign in to comment.