diff --git a/tests/unit/modules/test_libcloud_loadbalancer.py b/tests/unit/modules/test_libcloud_loadbalancer.py index d6c07f96de..9a7da90be5 100644 --- a/tests/unit/modules/test_libcloud_loadbalancer.py +++ b/tests/unit/modules/test_libcloud_loadbalancer.py @@ -22,11 +22,10 @@ try: HAS_LIBCLOUD = True except ImportError: HAS_LIBCLOUD = False - MockLBDriver = object -if HASLIBCLOUD: +if HAS_LIBCLOUD: class MockLBDriver(BaseDriver): - def __init__(self): + def __init__(self): # pylint: disable=W0231 self._TEST_BALANCER = LoadBalancer( id='test_id', name='test_balancer', state=0, # RUNNING @@ -80,6 +79,10 @@ if HASLIBCLOUD: return [self._TEST_MEMBER] +else: + MockLBDriver = object + + def get_mock_driver(): return MockLBDriver()