예제 #1
0
    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})
예제 #2
0
    def setUp(self):
        django.setup()

        self.broker = HostBroker()
        self.broker.load_configuration({
            'type': HostBroker().broker_type,
            'host_path': '/host/path'
        })
예제 #3
0
    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})
예제 #4
0
    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)
예제 #5
0
    def setUp(self):
        django.setup()

        self.root_path = '/my/test/path'
        self.broker = HostBroker()