home
·
contact
·
privacy
projects
/
plomtask
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
More tests refactoring.
[plomtask]
/
tests
/
processes.py
diff --git
a/tests/processes.py
b/tests/processes.py
index 160442b287a08733ac6c4546ec77e696216ca4f7..578d545a9d1004c53121a2f2b785b434e791856d 100644
(file)
--- a/
tests/processes.py
+++ b/
tests/processes.py
@@
-24,6
+24,7
@@
class TestsSansDBProcessStep(TestCaseSansDB):
class TestsWithDB(TestCaseWithDB):
"""Module tests requiring DB setup."""
checked_class = Process
class TestsWithDB(TestCaseWithDB):
"""Module tests requiring DB setup."""
checked_class = Process
+ test_versioneds = {'title': str, 'description': str, 'effort': float}
def three_processes(self) -> tuple[Process, Process, Process]:
"""Return three saved processes."""
def three_processes(self) -> tuple[Process, Process, Process]:
"""Return three saved processes."""
@@
-54,13
+55,8
@@
class TestsWithDB(TestCaseWithDB):
p.save(self.db_conn)
return p, set_1, set_2, set_3
p.save(self.db_conn)
return p, set_1, set_2, set_3
- def test_Process_
saving_and_cach
ing(self) -> None:
+ def test_Process_
conditions_sav
ing(self) -> None:
"""Test .save/.save_core."""
"""Test .save/.save_core."""
- kwargs = {'id_': 1}
- self.check_saving_and_caching(**kwargs)
- self.check_saving_of_versioned('title', str)
- self.check_saving_of_versioned('description', str)
- self.check_saving_of_versioned('effort', float)
p, set1, set2, set3 = self.p_of_conditions()
p.uncache()
r = Process.by_id(self.db_conn, p.id_)
p, set1, set2, set3 = self.p_of_conditions()
p.uncache()
r = Process.by_id(self.db_conn, p.id_)
@@
-193,14
+189,8
@@
class TestsWithDB(TestCaseWithDB):
class TestsWithDBForProcessStep(TestCaseWithDB):
"""Module tests requiring DB setup."""
checked_class = ProcessStep
class TestsWithDBForProcessStep(TestCaseWithDB):
"""Module tests requiring DB setup."""
checked_class = ProcessStep
-
- def test_ProcessStep_saving_and_caching(self) -> None:
- """Test .save/.save_core."""
- kwargs = {'id_': 1,
- 'owner_id': 2,
- 'step_process_id': 3,
- 'parent_step_id': 4}
- self.check_saving_and_caching(**kwargs)
+ default_init_kwargs = {'owner_id': 2, 'step_process_id': 3,
+ 'parent_step_id': 4}
def test_ProcessStep_from_table_row(self) -> None:
"""Test .from_table_row() properly reads in class from DB"""
def test_ProcessStep_from_table_row(self) -> None:
"""Test .from_table_row() properly reads in class from DB"""