def test_get_not_found(self, dao_find_profile_by_userid, dao_is_cti_enabled): userid = 1 dao_find_profile_by_userid.return_value = None dao_is_cti_enabled.return_value = True result = user_cti_profile_services.get(userid) assert_that(result.user_id, equal_to(userid)) assert_that(result.cti_profile_id, none()) self.assertTrue(result.enabled)
def test_get(self, dao_find_profile_by_userid, dao_is_cti_enabled): userid = 1 cti_profile = CtiProfile(id=2) dao_find_profile_by_userid.return_value = cti_profile dao_is_cti_enabled.return_value = True result = user_cti_profile_services.get(userid) assert_that(result.user_id, equal_to(userid)) assert_that(result.cti_profile_id, equal_to(cti_profile.id)) self.assertTrue(result.enabled) dao_is_cti_enabled.assert_called_with(userid)
def get_cti_configuration(userid): url.check_user_exists(userid) model = user_cti_profile_services.get(userid) result = formatter.to_api(model) return make_response(result, 200)
def get_cti_configuration(userid): model = user_cti_profile_services.get(userid) result = formatter.to_api(model) return make_response(result, 200)