def test_update_verify_path(self): with mock.patch('tddtags.core.ModuleUpdater._update_step1', spec=True) as ModCon: # --> Prep updater = ModuleUpdater(ut_module=self.ut_module) updater._update_step1.side_effect = self.return_true loader = ModuleLoader(anchor_dir=self.anchor_dir) mod = loader.load_module(name=self.tmp_module_name) # --> Test reply = updater.update(loaded_module=mod) parm_info = [('loaded_module', 0), ('module_path', 1)] kwargs = self.get_patched_call_parms(parm_info, updater._update_step1, 0) self.assertTrue(self.tmp_file in kwargs['module_path']) self.assertEqual(kwargs['loaded_module'], mod)
def test_update_no_save(self): with mock.patch('tddtags.core.UTModuleContainer.save_module', spec=True) as ModCon: # --> Prep updater = ModuleUpdater(ut_module=self.ut_module) loader = ModuleLoader(anchor_dir=self.anchor_dir) mod = loader.load_module(name=self.tmp_module_name) tddtags.core.tddtags_config['save'] = False # --> Need something new to do (Remember, this just uses the ut_module setup in setUp()) ut_class = self.ut_module.class_list['ChildSampleTests'] ut_class.add_method('eat_peanuts') # --> Test reply = updater.update(loaded_module=mod) self.assertEqual(updater.container.save_module.call_count, 0)