def test_delete_employee_exception(self, mock_print, mock_table_menu, mock_db): mock_db().commit_data.side_effect = Exception admin = Admin() admin.delete_employee() mock_db().delete_member.assert_called_once() mock_db().delete_user_all_roles.assert_called_once() mock_db().rollback_data.assert_called_once()
def test_delete_employee_no_emp(self, mock_print, mock_table_menu, mock_db): mock_table_menu.return_value = None admin = Admin() admin.delete_employee() mock_db().show_members.assert_called_once() mock_table_menu.assert_called_once()
def test_delete_employee(self, mock_print, mock_table_menu, mock_db): admin = Admin() admin.delete_employee() mock_db().delete_member.assert_called_once() mock_db().delete_user_all_roles.assert_called_once() mock_db().commit_data.assert_called_once()