diff --git a/src/viralhostrange/viralhostrangedb/tests/test_business_process.py b/src/viralhostrange/viralhostrangedb/tests/test_business_process.py index b01a07d8ed9862fb55d9a24fefdd8aafc9dda817..42348ebd1b2aef11a7f9de45648d80d2af425d90 100644 --- a/src/viralhostrange/viralhostrangedb/tests/test_business_process.py +++ b/src/viralhostrange/viralhostrangedb/tests/test_business_process.py @@ -9,7 +9,7 @@ from django.test import TestCase from django.utils import timezone from viralhostrangedb import business_process, models -from viralhostrangedb.business_process import extract_name_and_identifiers, ImportationObserver +from viralhostrangedb.business_process import extract_name_and_identifiers, ImportationObserver, DataSourceAlteredData from viralhostrangedb.tests.test_views_others import ViewTestCase logger = logging.getLogger(__name__) @@ -669,6 +669,15 @@ class TestOthers(TestCase): self.assertEqual(name, expected_name) self.assertDictEqual(identifiers, expected_both_identifier_dict) + def test_backup_data_source(self): + self.assertRaises( + AssertionError, + business_process.backup_data_source, + user=None, + data_source=None, + altered_data=DataSourceAlteredData.ALL, + ) + class TestNCBIIdentifierStatus(TestCase): def test_biopython_ok(self): diff --git a/src/viralhostrange/viralhostrangedb/tests/test_other.py b/src/viralhostrange/viralhostrangedb/tests/test_other.py new file mode 100644 index 0000000000000000000000000000000000000000..d08f6f0d08f929612a63f69c40ba2869d946230d --- /dev/null +++ b/src/viralhostrange/viralhostrangedb/tests/test_other.py @@ -0,0 +1,21 @@ +import logging + +from django.test import TestCase + +from viralhostrangedb import business_process + +logger = logging.getLogger(__name__) + + +class OnlyForCoverage(TestCase): + + def test_ImportationObserver(self): + class MyImportationObserver(business_process.ImportationObserver): + def notify_host_error(self, *args, **kwargs): + super().notify_host_error(*args, **kwargs) + + def notify_virus_error(self, *args, **kwargs): + super().notify_virus_error(*args, **kwargs) + + MyImportationObserver().notify_host_error(None, None) + MyImportationObserver().notify_virus_error(None, None)