Example #1
0
    def test_issue_novaclient_command_found(self):
        zone = FakeZone(1, 'http://example.com', 'bob', 'xxx')
        self.assertEquals(api._issue_novaclient_command(
                    FakeNovaClient(FakeServerCollection()),
                    zone, "servers", "get", 100).a, 10)

        self.assertEquals(api._issue_novaclient_command(
                    FakeNovaClient(FakeServerCollection()),
                    zone, "servers", "find", name="test").b, 22)

        self.assertEquals(api._issue_novaclient_command(
                    FakeNovaClient(FakeServerCollection()),
                    zone, "servers", "pause", 100), None)
Example #2
0
    def test_issue_novaclient_command_not_found(self):
        zone = FakeZone(1, 'http://example.com', 'bob', 'xxx')
        self.assertEquals(api._issue_novaclient_command(
                    FakeNovaClient(FakeEmptyServerCollection()),
                    zone, "servers", "get", 100), None)

        self.assertEquals(api._issue_novaclient_command(
                    FakeNovaClient(FakeEmptyServerCollection()),
                    zone, "servers", "find", name="test"), None)

        self.assertEquals(api._issue_novaclient_command(
                    FakeNovaClient(FakeEmptyServerCollection()),
                    zone, "servers", "any", "name"), None)
    def test_issue_novaclient_command_not_found(self):
        zone = FakeZone('http://example.com', 'bob', 'xxx')
        self.assertEquals(
            api._issue_novaclient_command(
                FakeNovaClient(FakeEmptyServerCollection()), zone, "servers",
                "get", 100), None)

        self.assertEquals(
            api._issue_novaclient_command(
                FakeNovaClient(FakeEmptyServerCollection()), zone, "servers",
                "find", "name"), None)

        self.assertEquals(
            api._issue_novaclient_command(
                FakeNovaClient(FakeEmptyServerCollection()), zone, "servers",
                "any", "name"), None)
Example #4
0
    def test_issue_novaclient_command_found(self):
        zone = FakeZone(1, 'http://example.com', 'bob', 'xxx')
        self.assertEquals(
            api._issue_novaclient_command(
                FakeNovaClient(FakeServerCollection()), zone, "servers", "get",
                100).a, 10)

        self.assertEquals(
            api._issue_novaclient_command(FakeNovaClient(
                FakeServerCollection()),
                                          zone,
                                          "servers",
                                          "find",
                                          name="test").b, 22)

        self.assertEquals(
            api._issue_novaclient_command(
                FakeNovaClient(FakeServerCollection()), zone, "servers",
                "pause", 100), None)