@@ -54,11 +54,6 @@ def test_carepoint_init(self, sup_mk, db_mk):
5454 cp = Carepoint (** self .cp_args )
5555 sup_mk .assert_called_once_with (Carepoint , cp )
5656
57- def test_carepoint_assigns_instance_dbs (self ):
58- self .assertEqual (
59- self .db_mock (), self .carepoint .dbs ['cph' ],
60- )
61-
6257 def test_carepoint_initial_iter_refresh (self ):
6358 self .assertFalse (
6459 self .carepoint .iter_refresh
@@ -77,6 +72,10 @@ def test_cph_db_init(self):
7772 def test_cph_db_assign (self ):
7873 self .carepoint .dbs ['cph' ] = self .db_mock
7974
75+ def test_carepoint_assigns_db_params (self ):
76+ """ It should assign the database params as an instance var """
77+ self .assertIsInstance (self .carepoint .db_params , dict )
78+
8079 def test_non_dir (self ):
8180 '''
8281 Test to make sure that an EnvironmentError is raised with an
@@ -103,6 +102,13 @@ def test_model_methods(self):
103102 model_obj = self .carepoint ['TestModel' ]
104103 self .assertTrue (model_obj .run ()) # < classmethods are exposed
105104
105+ def test_init_env_clear (self ):
106+ """ It should clear the global environment when True """
107+ with mock .patch .object (self .carepoint , 'dbs' ) as dbs :
108+ dbs .clear .side_effect = EndTestException
109+ with self .assertRaises (EndTestException ):
110+ self .carepoint ._init_env (True )
111+
106112 #
107113 # Test the session handler
108114 #
0 commit comments