replaced custom command pattern exceptions with attributeerror exceptions.

This commit is contained in:
tylerlaberge
2016-08-28 20:27:18 -04:00
parent ccc203f1e6
commit 7501604bbf
2 changed files with 5 additions and 20 deletions

View File

@@ -1,7 +1,6 @@
from unittest import TestCase
from pypatterns.behavioral.command import InvalidActionException, InvalidInvokerCommandException, \
Receiver, Command, Invoker
from pypatterns.behavioral.command import Receiver, Command, Invoker
class ReceiverTestCase(TestCase):
@@ -38,7 +37,7 @@ class ReceiverTestCase(TestCase):
@raise AssertionError: If the test fails.
"""
with self.assertRaises(InvalidActionException):
with self.assertRaises(AttributeError):
self.thermostat.action('foo')
@@ -176,7 +175,7 @@ class InvokerTestCase(TestCase):
def unexecute(self):
return self._receiver.action('turn_off')
with self.assertRaises(InvalidInvokerCommandException):
with self.assertRaises(AttributeError):
self.worker.execute(TurnOnLightCommand(Light))
def test_undo(self):