-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Test that I can make a Case instance. #2714
- Loading branch information
Showing
3 changed files
with
19 additions
and
0 deletions.
There are no files selected for viewing
2 changes: 2 additions & 0 deletions
2
data-serving/reusable-data-service/reusable_data_service/__init__.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,3 @@ | ||
__version__ = '0.1.0' | ||
|
||
from .model.case import Case |
12 changes: 12 additions & 0 deletions
12
data-serving/reusable-data-service/reusable_data_service/model/case.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import dataclasses | ||
|
||
@dataclasses.dataclass | ||
class DayZeroCase: | ||
"""This class implements the "day-zero" data schema for Global.health. | ||
At the beginning of an outbreak, we want to collect at least this much | ||
information about an individual case for the line list.""" | ||
pass | ||
|
||
# Actually we want to capture extra fields which can be specified dynamically: | ||
# so Case is the class that you should use. | ||
Case = dataclasses.make_dataclass('Case', fields=[], bases=(DayZeroCase,)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
from reusable_data_service import Case | ||
|
||
def test_instantiating_case(): | ||
case = Case() | ||
assert case is not None |