示例#1
0
class TestDriver(unittest.TestCase):
    def setUp(self):
        from libcloudcore.drivers.bigv import Driver

        self.Driver = Driver
        self.driver = Driver("username", "password")
        self.model = self.driver.model
        self.operation = self.model.get_operation("list_virtual_machines")

    def test_mro(self):
        self.assertEqual(
            inspect.getmro(self.Driver),
            (
                self.Driver,
                Driver,
                ErrorParser,
                Validation,
                RequestsBackend,
                BasicAuth,
                JsonSerializer,
                Serializer,
                Layer,
                object,
            ),
        )

    def test_build_request(self):
        request = Request()
        self.driver.before_call(request, self.operation, account_id=1, group_id=2)

        self.assertEqual(request.uri, "accounts/1/groups/2/virtual_machines")
示例#2
0
    def setUp(self):
        from libcloudcore.drivers.bigv import Driver

        self.Driver = Driver
        self.driver = Driver("username", "password")
        self.model = self.driver.model
        self.operation = self.model.get_operation("list_virtual_machines")