Skip to content

Commit

Permalink
Test that I can make a Case instance. #2714
Browse files Browse the repository at this point in the history
  • Loading branch information
iamleeg committed Jun 17, 2022
1 parent ee395ee commit f2450ed
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
__version__ = '0.1.0'

from .model.case import Case
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,))
5 changes: 5 additions & 0 deletions data-serving/reusable-data-service/tests/test_case_model.py
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

0 comments on commit f2450ed

Please sign in to comment.