def test_compute_handler_short_name(self): # Since the "docker" library is installed, this test actually imports # docker before importing the real docker Compute, hence the warning. settings.configure({'compute': {'arch': 'docker'}}) # Suppress imp warnings caused by docker with warnings.catch_warnings(): warnings.simplefilter('ignore') # Make sure it worked self.assertIsInstance(utils.ComputeHandler()._connection, terra.compute.docker.Compute)
def test_compute_handler_from_settings(self): # Test handler working self.assertIsInstance(utils.ComputeHandler()._connection, Compute)
def test_compute_handler_from_override(self): settings.configure({}) self.assertIsInstance(utils.ComputeHandler()._connection, terra.compute.dummy.Compute) self.assertIsInstance( utils.ComputeHandler(Compute.__module__)._connection, Compute)
def test_compute_handler(self): settings.configure({'compute': {'arch': 'terra.compute.dummy'}}) test_compute = utils.ComputeHandler() self.assertIsInstance(test_compute._connection, terra.compute.dummy.Compute)