diff clipkit_repo/tests/unit/test_warnings.py @ 0:49b058e85902 draft

"planemo upload for repository https://github.com/jlsteenwyk/clipkit commit cbe1e8577ecb1a46709034a40dff36052e876e7a-dirty"
author padge
date Fri, 25 Mar 2022 13:04:31 +0000
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/clipkit_repo/tests/unit/test_warnings.py	Fri Mar 25 13:04:31 2022 +0000
@@ -0,0 +1,17 @@
+import pytest
+
+from clipkit.warnings import check_if_all_sites_were_trimmed, check_if_entry_contains_only_gaps
+
+
+class TestWarnings(object):
+    def test_all_sites_trimmed(self, mocker):
+        mocked_warning = mocker.patch('clipkit.warnings.logger.warning')
+        keepD = dict(some_id="")
+        check_if_all_sites_were_trimmed(keepD)
+        mocked_warning.assert_called_once_with('WARNING: All sites trimmed from alignment. Please use different parameters.')
+
+    def test_gaps_only(self, mocker):
+        mocked_warning = mocker.patch('clipkit.warnings.logger.warning')
+        keepD = dict(some_id="-")
+        check_if_entry_contains_only_gaps(keepD)
+        mocked_warning.assert_called_once_with('''WARNING: header id 'some_id' contains only gaps''')