Пример #1
0
    def test_given_no_extension_then_returns_none(self, find_by_line_id, extension_get):
        line_id = 1
        find_by_line_id.return_value = None

        result = ule_service.find_extension(line_id)

        assert_that(result, none())
Пример #2
0
    def test_given_extension_associated_then_returns_extension(self, find_by_line_id, extension_get):
        line_id = 1
        find_by_line_id.return_value = Mock(LineExtension, extension_id=1)
        extension = extension_get.return_value = Mock(Extension)

        result = ule_service.find_extension(line_id)

        assert_that(result, equal_to(extension))