Skip to content

Commit

Permalink
rm dead code path
Browse files Browse the repository at this point in the history
  • Loading branch information
Rich Jones committed Nov 28, 2016
1 parent fc9f84b commit 7288471
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
3 changes: 2 additions & 1 deletion tests/test_one_env.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"lonely": {
"s3_bucket": "lmbda",
"app_function": "app.app"
"app_function": "app.app",
"delete_zip": true
}
}
7 changes: 7 additions & 0 deletions tests/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -856,6 +856,13 @@ def test_cli_default(self):
zappa_cli.handle(argv)
self.assertEqual(system_exit.exception.code, 1)

zappa_cli = ZappaCLI()
argv = '-s tests/test_one_env.json status --all'.split()
# It'll fail, but at least it'll cover it.
with self.assertRaises(SystemExit) as system_exit:
zappa_cli.handle(argv)
self.assertEqual(system_exit.exception.code, 1)

zappa_cli = ZappaCLI()
argv = '-s test_settings.json status'.split()
with self.assertRaises(SystemExit) as system_exit:
Expand Down
3 changes: 1 addition & 2 deletions zappa/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,6 @@ def handle(self, argv=None):
environments.append(self.zappa_settings.keys()[0])
else:
parser.error("Please supply an environment to interact with.")
sys.exit(1)
else:
environments.append(self.command_env[1])

Expand Down Expand Up @@ -1351,7 +1350,7 @@ def load_settings_file(self, settings_file="zappa_settings.json"):
with open(settings_file) as json_file:
try:
self.zappa_settings = json.load(json_file)
except ValueError:
except ValueError: # pragma: no cover
raise ValueError("Unable to load the zappa settings JSON. It may be malformed.")

def create_package(self):
Expand Down

0 comments on commit 7288471

Please sign in to comment.