示例#1
0
    def test_environment_or_account(self):
        args = [
            '--account', self.account, '--environment', self.environment, 'wat'
        ]

        with self.assertRaises(SystemExit) as exc:
            run.main(args)
            self.assertIn(run.ENV_AND_ACCT_ERROR, str(exc.exception))
示例#2
0
    def test_no_apikey(self):
        args = ['--account', self.account, '--username', 'foo', 'wat']

        with self.assertRaises(SystemExit) as exc:
            run.main(args)
            self.assertIn(run.NO_USER_OR_APIKEY_ERROR, str(exc.exception))
示例#3
0
    def test_environment_with_role(self):
        args = ['--environment', 'foo', '--role', self.role, 'wat']

        with self.assertRaises(SystemExit) as exc:
            run.main(args)
            self.assertIn(run.ENV_AND_ROLE_ERROR, str(exc.exception))
示例#4
0
    def test_no_account_or_environment(self):
        args = ['wat']

        with self.assertRaises(SystemExit) as exc:
            run.main(args)
            self.assertIn(run.NO_ACCT_OR_ENV_ERROR, str(exc.exception))
示例#5
0
    def test_no_apikey(self):
        args = ["--account", self.account, "--username", "foo", "wat"]

        with self.assertRaises(SystemExit) as exc:
            run.main(args)
            self.assertIn(run.NO_USER_OR_APIKEY_ERROR, str(exc.exception))
示例#6
0
    def test_environment_with_role(self):
        args = ["--environment", "foo", "--role", self.role, "wat"]

        with self.assertRaises(SystemExit) as exc:
            run.main(args)
            self.assertIn(run.ENV_AND_ROLE_ERROR, str(exc.exception))