From dc226495647a101c0225a31988f62bbacefc63f9 Mon Sep 17 00:00:00 2001 From: Dave Smith Date: Sat, 20 Jun 2020 17:29:02 -0500 Subject: [PATCH] Close GH-5 --- src/tuulbachs/exception.py | 2 +- src/tuulcli/cli_color.py | 14 -------------- src/tuuldevops/pipeline_steps.py | 10 ---------- src/tuuldevops/tag_current_version.py | 11 ----------- src/tuuldevops/update_version.py | 11 ----------- tests/tuulbachs/exception_test.py | 8 +++++++- tests/tuuldevops/pipeline_steps_test.py | 7 ++++++- tests/tuuldevops/tag_current_version_test.py | 9 +++++++++ version.yaml | 2 +- 9 files changed, 24 insertions(+), 50 deletions(-) diff --git a/src/tuulbachs/exception.py b/src/tuulbachs/exception.py index abedfb2..f76d533 100644 --- a/src/tuulbachs/exception.py +++ b/src/tuulbachs/exception.py @@ -1,5 +1,5 @@ """ -exceptions.py +exception.py ========================== This module contains the set of tuulbachs' exceptions. """ diff --git a/src/tuulcli/cli_color.py b/src/tuulcli/cli_color.py index 35dd5f9..7a0080d 100644 --- a/src/tuulcli/cli_color.py +++ b/src/tuulcli/cli_color.py @@ -16,17 +16,3 @@ class CliColor: FAIL = '\033[91m' ENDC = '\033[0m' BOLD = '\033[1m' - - -# ----- -def main(): - print(f"{CliColor.HEAD}header{CliColor.ENDC}") - print(f"{CliColor.GREEN}ok, green{CliColor.ENDC}") - print(f"{CliColor.WARN}warning{CliColor.ENDC}") - print(f"{CliColor.FAIL}failblog{CliColor.ENDC}") - print(f"{CliColor.BOLD}bold{CliColor.ENDC}") - - -# ----- -if '__main__' == __name__: - main() diff --git a/src/tuuldevops/pipeline_steps.py b/src/tuuldevops/pipeline_steps.py index 4a2851e..5ad9c74 100644 --- a/src/tuuldevops/pipeline_steps.py +++ b/src/tuuldevops/pipeline_steps.py @@ -14,13 +14,3 @@ def major_step(title, description): """ print(f'{CliColor.HEAD}{CliColor.BOLD}{title}: ' + f'{CliColor.ENDC}{description}') - - -# ----- -def main(): - major_step('Important step', 'kicking things off...') - - -# ----- -if '__main__' == __name__: - main() diff --git a/src/tuuldevops/tag_current_version.py b/src/tuuldevops/tag_current_version.py index e458e30..b388ad8 100644 --- a/src/tuuldevops/tag_current_version.py +++ b/src/tuuldevops/tag_current_version.py @@ -16,14 +16,3 @@ def tag_product_version(conf_filename): given in conf_filename """ tag_current_signed(emit_version(conf_filename)) - - -# ----- -def main(): - # Show example usage - tag_product_version('../version.yaml') - - -# ----- -if '__main__' == __name__: - main() diff --git a/src/tuuldevops/update_version.py b/src/tuuldevops/update_version.py index e1400ea..b8a569a 100644 --- a/src/tuuldevops/update_version.py +++ b/src/tuuldevops/update_version.py @@ -13,14 +13,3 @@ def update_product_version(conf_filename, new_ver): Write a new_ver as the new value for the 'version' key in the conf_filename """ update_value(conf_filename, 'version', new_ver) - - -# ----- -def main(): - # Show example usage - update_product_version('../version.yaml', '0.0.0') - - -# ----- -if '__main__' == __name__: - main() diff --git a/tests/tuulbachs/exception_test.py b/tests/tuulbachs/exception_test.py index 6f044b7..a625b4f 100644 --- a/tests/tuulbachs/exception_test.py +++ b/tests/tuulbachs/exception_test.py @@ -1 +1,7 @@ -import tuulbachs.exception +from tuulbachs.exception import TuulError + + +def test_TuulError(): + a = TuulError() + b = TuulError('with a message') + assert True; diff --git a/tests/tuuldevops/pipeline_steps_test.py b/tests/tuuldevops/pipeline_steps_test.py index c423307..c1b1e66 100644 --- a/tests/tuuldevops/pipeline_steps_test.py +++ b/tests/tuuldevops/pipeline_steps_test.py @@ -1 +1,6 @@ -import tuuldevops.pipeline_steps +from tuuldevops.pipeline_steps import major_step + + +def test_major_step(): + major_step('a title', 'a description') + assert True diff --git a/tests/tuuldevops/tag_current_version_test.py b/tests/tuuldevops/tag_current_version_test.py index 8595314..ac38b20 100644 --- a/tests/tuuldevops/tag_current_version_test.py +++ b/tests/tuuldevops/tag_current_version_test.py @@ -1 +1,10 @@ import tuuldevops.tag_current_version + + +def test_fnname(mocker): + mocker.patch('tuuldevops.tag_current_version.tag_current_signed') + mocker.patch('tuuldevops.tag_current_version.emit_version') + fname = 'whatevs' + tuuldevops.tag_current_version.tag_product_version(fname) + tuuldevops.tag_current_version.emit_version.assert_called_once_with(fname) + tuuldevops.tag_current_version.tag_current_signed.assert_called_once() diff --git a/version.yaml b/version.yaml index 84c8c74..7db6329 100644 --- a/version.yaml +++ b/version.yaml @@ -1,3 +1,3 @@ # tuulbachs-formatted version file product_name: tuulbachs -version: 0.7.8 +version: 0.8.0