Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
ViralHostRangeDB
Manage
Activity
Members
Plan
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Container Registry
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
hub
ViralHostRangeDB
Commits
3876b5c3
Commit
3876b5c3
authored
3 years ago
by
Bryan BRANCOTTE
Browse files
Options
Downloads
Patches
Plain Diff
improve coverage
parent
5f44b381
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/viralhostrange/viralhostrangedb/tests/test_business_process.py
+10
-1
10 additions, 1 deletion
...hostrange/viralhostrangedb/tests/test_business_process.py
src/viralhostrange/viralhostrangedb/tests/test_other.py
+21
-0
21 additions, 0 deletions
src/viralhostrange/viralhostrangedb/tests/test_other.py
with
31 additions
and
1 deletion
src/viralhostrange/viralhostrangedb/tests/test_business_process.py
+
10
−
1
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
):
...
...
This diff is collapsed.
Click to expand it.
src/viralhostrange/viralhostrangedb/tests/test_other.py
0 → 100644
+
21
−
0
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
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment