Esempio n. 1
0
 def setUp(self):
     super().setUp()
     self.parser = ArgumentParser()
     self.cmd = cli.cmd_init(self.parser)
     self.maas_region_path = init.get_maas_region_bin_path()
     self.call_mock = self.patch(init.subprocess, 'call')
     self.check_output_mock = self.patch(init.subprocess, 'check_output')
     self.check_output_mock.return_value = json.dumps(
         {'external_auth_url': ''})
Esempio n. 2
0
 def setUp(self):
     super().setUp()
     self.parser = ArgumentParser()
     self.cmd = cli.cmd_init(self.parser)
     self.maas_region_path = init.get_maas_region_bin_path()
     self.call_mock = self.patch(init.subprocess, "call")
     self.check_output_mock = self.patch(init.subprocess, "check_output")
     self.check_output_mock.return_value = json.dumps(
         {"external_auth_url": ""})
     # avoid printouts
     self.mock_stdout = self.patch(init.sys, "stdout", StringIO())
     self.mock_stderr = self.patch(init.sys, "stderr", StringIO())