def test_missing_host_path(self): """Tests calling HostBroker.validate_configuration() with a missing host_path value""" # Call method to test broker = HostBroker() self.assertRaises(InvalidBrokerConfiguration, broker.validate_configuration, {'type': HostBroker().broker_type})
def setUp(self): django.setup() self.broker = HostBroker() self.broker.load_configuration({ 'type': HostBroker().broker_type, 'host_path': '/host/path' })
def test_successfully(self): """Tests calling HostBroker.validate_configuration() successfully""" host_path = 'host:/dir' # Call method to test broker = HostBroker() # No exception is success broker.validate_configuration({'type': HostBroker().broker_type, 'host_path': host_path})
def test_successfully(self): """Tests calling HostBroker.load_configuration() successfully""" host_path = '/host/path' # Call method to test broker = HostBroker() broker.load_configuration({'type': HostBroker().broker_type, 'host_path': host_path}) volume = broker.volume self.assertEqual(volume.driver, None) self.assertEqual(volume.host, True) self.assertEqual(volume.remote_path, host_path)
def setUp(self): django.setup() self.root_path = '/my/test/path' self.broker = HostBroker()