@@ -27,7 +27,9 @@ def test_make_towncrier_cmd():
2727
2828def test_bump ():
2929 ver_file = get_conf_key ("version_file_rel_path" )
30- with fake_project_root (proj_version = "14.0.0.1.0" ) as runner :
30+ with fake_project_root (
31+ proj_version = "14.0.0.1.0" , mock_marabunta_file = True
32+ ) as runner :
3133 with ver_file .open () as fd :
3234 assert fd .read () == "14.0.0.1.0"
3335 # run init to get all files ready (eg: bumpversion)
@@ -67,7 +69,9 @@ def test_bump():
6769
6870
6971def test_bump_changelog ():
70- with fake_project_root (proj_version = "14.0.0.1.0" ) as runner :
72+ with fake_project_root (
73+ proj_version = "14.0.0.1.0" , mock_marabunta_file = True
74+ ) as runner :
7175 # run init to get all files ready (eg: bumpversion)
7276 runner .invoke (init , catch_exceptions = False )
7377 changes = (
@@ -96,5 +100,28 @@ def test_bump_changelog():
96100 assert result .output .splitlines () == [
97101 "Running: bumpversion minor" ,
98102 "Running: towncrier build --yes --version=14.0.0.2.0" ,
103+ "Updating marabunta migration file" ,
104+ ]
105+ assert result .exit_code == 0
106+
107+
108+ def test_bump_update_marabunta_file ():
109+ with fake_project_root (
110+ proj_version = "14.0.0.1.0" , mock_marabunta_file = True
111+ ) as runner :
112+ # run init to get all files ready (eg: bumpversion)
113+ runner .invoke (init , catch_exceptions = False )
114+ result = runner .invoke (
115+ release .bump , ["--type" , "minor" ], catch_exceptions = False
116+ )
117+ with get_conf_key ("marabunta_mig_file_rel_path" ).open () as fd :
118+ content = fd .read ()
119+ # TODO: improve these checks
120+ assert "14.0.0.2.0" in content
121+ assert "click-odoo-update" in content
122+ assert result .output .splitlines () == [
123+ "Running: bumpversion minor" ,
124+ "Running: towncrier build --yes --version=14.0.0.2.0" ,
125+ "Updating marabunta migration file" ,
99126 ]
100127 assert result .exit_code == 0
0 commit comments