diff --git a/tests/integration/deploy/test_deploy_command.py b/tests/integration/deploy/test_deploy_command.py index 7221c40264..a7ece04a5c 100644 --- a/tests/integration/deploy/test_deploy_command.py +++ b/tests/integration/deploy/test_deploy_command.py @@ -826,7 +826,7 @@ def test_deploy_with_invalid_config(self, template_file, config_file): deploy_process_execute = self.run_command(deploy_command_list) self.assertEqual(deploy_process_execute.process.returncode, 1) - self.assertIn("Error reading configuration: Unexpected character", str(deploy_process_execute.stderr)) + self.assertIn("SamConfigFileReadException: Unexpected character", str(deploy_process_execute.stderr)) @parameterized.expand([("aws-serverless-function.yaml", "samconfig-tags-list.toml")]) def test_deploy_with_valid_config_tags_list(self, template_file, config_file): diff --git a/tests/unit/lib/samconfig/test_file_manager.py b/tests/unit/lib/samconfig/test_file_manager.py index 3b5ddce96c..18df66474c 100644 --- a/tests/unit/lib/samconfig/test_file_manager.py +++ b/tests/unit/lib/samconfig/test_file_manager.py @@ -14,11 +14,16 @@ class TestTomlFileManager(TestCase): def test_read_toml(self): config_dir = tempfile.gettempdir() config_path = Path(config_dir, "samconfig.toml") - config_path.write_text("version=0.1\n[config_env.topic1.parameters]\nword='clarity'\n") + config_path.write_text( + "version=0.1\n[config_env.topic1.parameters]\nword='clarity'\nmultiword=['thing 1', 'thing 2']" + ) config_doc = TomlFileManager.read(config_path) self.assertEqual( config_doc, - {"version": 0.1, "config_env": {"topic1": {"parameters": {"word": "clarity"}}}}, + { + "version": 0.1, + "config_env": {"topic1": {"parameters": {"word": "clarity", "multiword": ["thing 1", "thing 2"]}}}, + }, ) def test_read_toml_invalid_toml(self): @@ -111,13 +116,18 @@ class TestYamlFileManager(TestCase): def test_read_yaml(self): config_dir = tempfile.gettempdir() config_path = Path(config_dir, "samconfig.yaml") - config_path.write_text("version: 0.1\nconfig_env:\n topic1:\n parameters:\n word: clarity\n") + config_path.write_text( + "version: 0.1\nconfig_env:\n topic1:\n parameters:\n word: clarity\n multiword: [thing 1, thing 2]" + ) config_doc = YamlFileManager.read(config_path) self.assertEqual( config_doc, - {"version": 0.1, "config_env": {"topic1": {"parameters": {"word": "clarity"}}}}, + { + "version": 0.1, + "config_env": {"topic1": {"parameters": {"word": "clarity", "multiword": ["thing 1", "thing 2"]}}}, + }, ) def test_read_yaml_invalid_yaml(self): @@ -189,7 +199,10 @@ def test_read_json(self): config_path = Path(config_dir, "samconfig.json") config_path.write_text( json.dumps( - {"version": 0.1, "config_env": {"topic1": {"parameters": {"word": "clarity"}}}}, + { + "version": 0.1, + "config_env": {"topic1": {"parameters": {"word": "clarity", "multiword": ["thing 1", "thing 2"]}}}, + }, indent=JsonFileManager.INDENT_SIZE, ) ) @@ -198,7 +211,10 @@ def test_read_json(self): self.assertEqual( config_doc, - {"version": 0.1, "config_env": {"topic1": {"parameters": {"word": "clarity"}}}}, + { + "version": 0.1, + "config_env": {"topic1": {"parameters": {"word": "clarity", "multiword": ["thing 1", "thing 2"]}}}, + }, ) def test_read_json_invalid_json(self):