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))
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))
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))
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))
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))
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))