示例#1
0
    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)
示例#2
0
    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)
示例#3
0
    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)
示例#4
0
    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)
示例#5
0
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)
示例#6
0
def get_cti_configuration(userid):
    model = user_cti_profile_services.get(userid)
    result = formatter.to_api(model)
    return make_response(result, 200)