예제 #1
0
파일: test_dao.py 프로젝트: jaunis/xivo-dao
    def test_given_extension_associated_to_user_incall_then_returns_incall(
            self):
        expected_incall = self.create_user_incall()

        result = dao.find_by_extension_id(expected_incall.extension_id)

        assert_that(result, equal_to(expected_incall))
예제 #2
0
파일: services.py 프로젝트: jaunis/xivo-dao
def _delete_incall_association(line_extension):
    incall = incall_dao.find_by_extension_id(line_extension.extension_id)
    incall_dao.delete(incall)
    extension_dao.dissociate_extension(line_extension.extension_id)
예제 #3
0
파일: test_dao.py 프로젝트: jaunis/xivo-dao
    def test_given_extension_associated_to_user_incall_then_returns_incall(self):
        expected_incall = self.create_user_incall()

        result = dao.find_by_extension_id(expected_incall.extension_id)

        assert_that(result, equal_to(expected_incall))
예제 #4
0
파일: test_dao.py 프로젝트: jaunis/xivo-dao
    def test_given_extension_to_line_then_returns_none(self):
        user_line_row = self.add_user_line_with_exten()

        result = dao.find_by_extension_id(user_line_row.extension_id)

        assert_that(result, none())
예제 #5
0
파일: test_dao.py 프로젝트: jaunis/xivo-dao
    def test_given_extension_associated_to_nothing_then_returns_none(self):
        extension_row = self.add_extension(exten='1000', context='default')

        result = dao.find_by_extension_id(extension_row.id)

        assert_that(result, none())
예제 #6
0
파일: test_dao.py 프로젝트: jaunis/xivo-dao
    def test_given_no_extension_then_returns_none(self):
        result = dao.find_by_extension_id(1)

        assert_that(result, none())
예제 #7
0
파일: services.py 프로젝트: jaunis/xivo-dao
def _delete_incall_association(line_extension):
    incall = incall_dao.find_by_extension_id(line_extension.extension_id)
    incall_dao.delete(incall)
    extension_dao.dissociate_extension(line_extension.extension_id)
예제 #8
0
파일: test_dao.py 프로젝트: jaunis/xivo-dao
    def test_given_extension_to_line_then_returns_none(self):
        user_line_row = self.add_user_line_with_exten()

        result = dao.find_by_extension_id(user_line_row.extension_id)

        assert_that(result, none())
예제 #9
0
파일: test_dao.py 프로젝트: jaunis/xivo-dao
    def test_given_extension_associated_to_nothing_then_returns_none(self):
        extension_row = self.add_extension(exten='1000', context='default')

        result = dao.find_by_extension_id(extension_row.id)

        assert_that(result, none())
예제 #10
0
파일: test_dao.py 프로젝트: jaunis/xivo-dao
    def test_given_no_extension_then_returns_none(self):
        result = dao.find_by_extension_id(1)

        assert_that(result, none())