File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -65,3 +65,26 @@ def test_maximal_config(self, tmp_path: Path):
6565 Path (__file__ ).parent / "maximal_bitbucket_pipelines.yml"
6666 ).read_text ()
6767 assert (tmp_path / "bitbucket-pipelines.yml" ).read_text () == expected_yml
68+
69+ def test_incorrect_indentation (self , tmp_path : Path ):
70+ # Arrange
71+ (tmp_path / "bitbucket-pipelines.yml" ).write_text ("""\
72+ - path: /
73+ backend:
74+ serviceName: <service_name>
75+ servicePort: <port>
76+ """ )
77+ # Use something like pre-commit so we try and modify the file
78+ (tmp_path / ".pre-commit-config.yaml" ).touch ()
79+
80+ # Act
81+ runner = CliRunner ()
82+ with change_cwd (tmp_path ):
83+ result = runner .invoke (app )
84+
85+ # Assert
86+ assert result .exit_code == 1 , result .output
87+ assert "mapping values are not allowed here" in result .output
88+ assert (
89+ "Hint: You may have incorrect indentation the YAML file." in result .output
90+ )
You can’t perform that action at this time.
0 commit comments