Beispiel #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)
Beispiel #2
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)
Beispiel #3
0
 def get_cti_configuration(user_id):
     user_dao.get(user_id)
     user_cti_profile = user_cti_profile_services.get(user_id)
     response = converter.encode(user_cti_profile)
     return Response(response=response, status=200, content_type="application/json")