File tree Expand file tree Collapse file tree 1 file changed +18
-1
lines changed
Expand file tree Collapse file tree 1 file changed +18
-1
lines changed Original file line number Diff line number Diff line change 44from packaging .version import parse as parse_version
55
66from pum .pum_config import PumConfig
7- from pum .exceptions import PumConfigError
7+ from pum .exceptions import PumConfigError , PumException
88from pum .hook import HookHandler
99import os
1010import platform
@@ -63,6 +63,23 @@ def test_version(self) -> None:
6363 )
6464 self .assertIsNone (last_version_result )
6565
66+ def test_empty_changelogs_directory (self ) -> None :
67+ """Test that an empty changelogs directory raises PumException."""
68+ import tempfile
69+
70+ with tempfile .TemporaryDirectory () as tmp :
71+ tmp_path = Path (tmp )
72+ # Create an empty changelogs directory
73+ (tmp_path / "changelogs" ).mkdir ()
74+ cfg = PumConfig (
75+ base_path = tmp_path ,
76+ pum = {"module" : "test_empty" },
77+ validate = False ,
78+ )
79+ with self .assertRaises (PumException ) as ctx :
80+ cfg .changelogs ()
81+ self .assertIn ("is empty" , str (ctx .exception ))
82+
6683 def test_hooks (self ) -> None :
6784 """Test hooks."""
6885 cfg = PumConfig .from_yaml (Path ("test" ) / "data" / "pre_post_sql_files" / ".pum.yaml" )
You can’t perform that action at this time.
0 commit comments