diff options
| author | Max Nanis | 2026-02-26 15:51:49 -0500 |
|---|---|---|
| committer | Max Nanis | 2026-02-26 15:51:49 -0500 |
| commit | 0bf32fadd85d5938ae29d489efdd82e2cd137300 (patch) | |
| tree | 814e8128947fb604dc7cc3509e72260d95757590 /tests/managers/test_hit.py | |
| parent | 04aee0dc7e908ce020d2d2c3f8ffb4a96424b883 (diff) | |
| download | amt-jb-0bf32fadd85d5938ae29d489efdd82e2cd137300.tar.gz amt-jb-0bf32fadd85d5938ae29d489efdd82e2cd137300.zip | |
Passing Managers into flow tasks for better pytest usage. Conftests broken out into seperate fixture files. Extensive type hinting.
Diffstat (limited to 'tests/managers/test_hit.py')
| -rw-r--r-- | tests/managers/test_hit.py | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/tests/managers/test_hit.py b/tests/managers/test_hit.py new file mode 100644 index 0000000..56a4f53 --- /dev/null +++ b/tests/managers/test_hit.py @@ -0,0 +1,52 @@ +from jb.models.hit import HitQuestion, HitType, Hit +from jb.managers.hit import HitTypeManager, HitManager + + +class TestHitQuestionManager: + + def test_base(self, question_record: HitQuestion): + assert isinstance(question_record, HitQuestion) + assert isinstance(question_record.id, int) + + +class TestHitTypeManager: + + def test_create(self, htm: HitTypeManager, hit_type_record_with_amt_id: HitType): + + _ = hit_type_record_with_amt_id + + assert isinstance(hit_type_record_with_amt_id.id, int) + assert isinstance(hit_type_record_with_amt_id.amt_hit_type_id, str) + + count1 = len(htm.filter_active()) + # assert count1 == 1 + + hit_type_record_with_amt_id.min_active = 0 + htm.set_min_active(hit_type=hit_type_record_with_amt_id) + + count2 = len(htm.filter_active()) + assert count2 == 0 + + +class TestHitManager: + + # def test_create + + # def update_status + + # def update_hit + + # def get_from_amt_id + + # get_from_amt_id_if_exists + + def test_get_active_count(self, hm: HitManager, hit_record: Hit): + + count = hm.get_active_count(hit_type_id=999_999_999) + assert isinstance(count, int) + assert count == 0 + + count = hm.get_active_count(hit_type_id=hit_record.hit_type_id) + assert count == 1 + + # filter_active_ids |
