Raise NotImplementedError instead of NotImplemented
NotImplementedError is the name of the exception (https://docs.python.org/2/library/exceptions.html). NotImplemented is the name of a constant (https://docs.python.org/2/library/constants.html). It makes no sense to raise a constant. The exception should be raised instead. Change-Id: I4969e26eb7b46f008ea3c8bd0093490c425f7069 Closes-Bug: #1339855
This commit is contained in:
parent
2697d83e4d
commit
6e3c011fc3
@ -52,7 +52,7 @@ class BasePollingManager(object):
|
||||
self._polling_completed = True
|
||||
|
||||
def _is_polling_required(self):
|
||||
raise NotImplemented
|
||||
raise NotImplementedError()
|
||||
|
||||
@property
|
||||
def is_polling_required(self):
|
||||
|
@ -43,6 +43,9 @@ class TestBasePollingManager(base.BaseTestCase):
|
||||
super(TestBasePollingManager, self).setUp()
|
||||
self.pm = polling.BasePollingManager()
|
||||
|
||||
def test__is_polling_required_should_not_be_implemented(self):
|
||||
self.assertRaises(NotImplementedError, self.pm._is_polling_required)
|
||||
|
||||
def test_force_polling_sets_interval_attribute(self):
|
||||
self.assertFalse(self.pm._force_polling)
|
||||
self.pm.force_polling()
|
||||
|
Loading…
Reference in New Issue
Block a user