Skip to content

Commit

Permalink
Added test for default architecture setting
Browse files Browse the repository at this point in the history
  • Loading branch information
gaborschulz committed Dec 21, 2022
1 parent 6c0e270 commit 7b2e0d7
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 138 deletions.
17 changes: 15 additions & 2 deletions test_settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
"CognitoIdentityId": "identity.cognitoIdentityId",
"APIStage": "stage"
},
"architecture": "arm64",
"events": [
{
"function": "tests.test_app.schedule_me",
Expand Down Expand Up @@ -128,5 +127,19 @@
"delete_local_zip": true,
"binary_support": true,
"additional_text_mimetypes": ["application/custommimetype"]
}
},
"arch_arm64": {
"s3_bucket": "lmbda",
"app_function": "tests.test_app.hello_world",
"delete_local_zip": true,
"debug": true,
"architecture": "arm64"
},
"archfail": {
"s3_bucket": "lmbda",
"app_function": "tests.test_app.hello_world",
"delete_local_zip": true,
"debug": true,
"architecture": "invalid_architecture"
}
}
132 changes: 0 additions & 132 deletions tests/test_bad_architecture_settings.json

This file was deleted.

13 changes: 9 additions & 4 deletions tests/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -1106,13 +1106,18 @@ def test_load_settings(self):
self.assertEqual(False, zappa_cli.stage_config["touch"])

def test_load_extended_settings(self):

zappa_cli = ZappaCLI()
zappa_cli.api_stage = "extendo"
zappa_cli.load_settings("test_settings.json")
self.assertEqual("lmbda", zappa_cli.stage_config["s3_bucket"])
self.assertEqual(True, zappa_cli.stage_config["touch"])
self.assertEqual('arm64', zappa_cli.stage_config['architecture'])
self.assertIn('x86_64', zappa_cli.architecture)

zappa_cli = ZappaCLI()
zappa_cli.api_stage = "arch_arm64"
zappa_cli.load_settings("test_settings.json")
self.assertIn('arm64', zappa_cli.stage_config["architecture"])
self.assertIn('arm64', zappa_cli.architecture)

zappa_cli = ZappaCLI()
zappa_cli.api_stage = "extendofail"
Expand All @@ -1132,9 +1137,9 @@ def test_load_extended_settings(self):
self.assertTrue(zappa_cli.stage_config["delete_local_zip"]) # The base

zappa_cli = ZappaCLI()
zappa_cli.api_stage = "ttt888"
zappa_cli.api_stage = "archfail"
with self.assertRaises(ValueError):
zappa_cli.load_settings("tests/test_bad_architecture_settings.json")
zappa_cli.load_settings("test_settings.json")

def test_load_settings__lambda_concurrency_enabled(self):
zappa_cli = ZappaCLI()
Expand Down

0 comments on commit 7b2e0d7

Please sign in to comment.