コード例 #1
0
ファイル: test_init.py プロジェクト: tjjh89017/maas
 def test_email(self):
     options = self.parser.parse_args(['--admin-email', '*****@*****.**'])
     init.create_admin_account(options)
     self.mock_print_msg.assert_called_with('Create first admin account')
     self.mock_call.assert_called_with(
         [self.maas_region_path,
          'createadmin', '--email', '*****@*****.**'])
コード例 #2
0
ファイル: test_init.py プロジェクト: shawnallen85/maas
 def test_email(self):
     options = self.parser.parse_args(["--admin-email", "*****@*****.**"])
     init.create_admin_account(options)
     self.mock_print_msg.assert_called_with("Create first admin account")
     self.mock_call.assert_called_with([
         self.maas_region_path, "createadmin", "--email", "*****@*****.**"
     ])
コード例 #3
0
ファイル: test_init.py プロジェクト: ajeetraina/maas
 def test_no_print_header(self):
     options = self.parser.parse_args([
         '--admin-username', 'my-user', '--admin-password', 'my-pass',
         '--admin-email', '*****@*****.**'
     ])
     init.create_admin_account(options)
     self.mock_print_msg.assert_not_called()
コード例 #4
0
ファイル: test_init.py プロジェクト: shawnallen85/maas
 def test_no_print_header(self):
     options = self.parser.parse_args([
         "--admin-username",
         "my-user",
         "--admin-password",
         "my-pass",
         "--admin-email",
         "*****@*****.**",
     ])
     init.create_admin_account(options)
     self.mock_print_msg.assert_not_called()
コード例 #5
0
ファイル: test_init.py プロジェクト: tjjh89017/maas
 def test_ssh_import(self):
     options = self.parser.parse_args(['--admin-ssh-import', 'lp:me'])
     init.create_admin_account(options)
     self.mock_print_msg.assert_called_with('Create first admin account')
     self.mock_call.assert_called_with(
         [self.maas_region_path, 'createadmin', '--ssh-import', 'lp:me'])
コード例 #6
0
ファイル: test_init.py プロジェクト: tjjh89017/maas
 def test_password(self):
     options = self.parser.parse_args(['--admin-password', 'my-pass'])
     init.create_admin_account(options)
     self.mock_print_msg.assert_called_with('Create first admin account')
     self.mock_call.assert_called_with(
         [self.maas_region_path, 'createadmin', '--password', 'my-pass'])
コード例 #7
0
ファイル: test_init.py プロジェクト: tjjh89017/maas
 def test_no_options(self):
     options = self.parser.parse_args([])
     init.create_admin_account(options)
     self.mock_print_msg.assert_called_with('Create first admin account')
     self.mock_call.assert_called_with(
         [self.maas_region_path, 'createadmin'])
コード例 #8
0
ファイル: test_init.py プロジェクト: shawnallen85/maas
 def test_ssh_import(self):
     options = self.parser.parse_args(["--admin-ssh-import", "lp:me"])
     init.create_admin_account(options)
     self.mock_print_msg.assert_called_with("Create first admin account")
     self.mock_call.assert_called_with(
         [self.maas_region_path, "createadmin", "--ssh-import", "lp:me"])
コード例 #9
0
ファイル: test_init.py プロジェクト: shawnallen85/maas
 def test_password(self):
     options = self.parser.parse_args(["--admin-password", "my-pass"])
     init.create_admin_account(options)
     self.mock_print_msg.assert_called_with("Create first admin account")
     self.mock_call.assert_called_with(
         [self.maas_region_path, "createadmin", "--password", "my-pass"])