Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
hub
ViralHostRangeDB
Commits
3876b5c3
Commit
3876b5c3
authored
Feb 08, 2022
by
Bryan BRANCOTTE
Browse files
improve coverage
parent
5f44b381
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/viralhostrange/viralhostrangedb/tests/test_business_process.py
View file @
3876b5c3
...
...
@@ -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
):
...
...
src/viralhostrange/viralhostrangedb/tests/test_other.py
0 → 100644
View file @
3876b5c3
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
)
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment