Пример #1
0
    def test_api_info_minimal(self):
        filename, callfile = write_script(self.dirname,
                                          output=self.API_INFO_YAML)
        self.cli = CLI.from_version(filename, self.VERSION, self.dirname)
        infos = self.cli.api_info()

        self.assertEquals(
            infos, {
                None:
                APIInfo(
                    ["10.235.227.251:17070"],
                    "admin",
                    "0f154812dd1c02973623c887b2565ea3",
                ),
                "controller":
                APIInfo(
                    ["10.235.227.251:17070"],
                    "admin",
                    "0f154812dd1c02973623c887b2565ea3",
                    "d3a5befc-c392-4722-85fc-631531e74a09",
                ),
                "default":
                APIInfo(
                    ["10.235.227.251:17070"],
                    "admin",
                    "0f154812dd1c02973623c887b2565ea3",
                    "b93f17f2-ad56-456d-8051-06e9f7ba46ec",
                ),
            })
        self.assert_called("show-controller --show-password --format=yaml",
                           callfile)
Пример #2
0
    def test_api_info_minimal(self):
        filename, callfile = write_script(self.dirname,
                                          output=self.API_INFO_JSON)
        self.cli = CLI.from_version(filename, self.VERSION, self.dirname)
        infos = self.cli.api_info()

        self.assertEquals(
            infos, {
                None:
                APIInfo(
                    ["10.235.227.251:17070"],
                    "admin",
                    "0f154812dd1c02973623c887b2565ea3",
                ),
                "controller":
                APIInfo(
                    ["10.235.227.251:17070"],
                    "admin",
                    "0f154812dd1c02973623c887b2565ea3",
                    "d3a5befc-c392-4722-85fc-631531e74a09",
                ),
            })
        self.assert_called("api-info --password --refresh --format=json",
                           callfile)
Пример #3
0
 def setUp(self):
     super(CLIJuju2Tests, self).setUp()
     self.dirname = tempfile.mkdtemp(prefix="txjuju-test-")
     filename, self.callfile = write_script(self.dirname)
     self.cli = CLI.from_version(filename, self.VERSION, self.dirname)