Пример #1
0
    def test_get_passes_generators_annotation(self, registry):
        annotation = mock.Mock(id=12345)
        svc = LinksService(base_url='http://example.com', registry=registry)

        result = svc.get(annotation, 'paramroute')

        assert result == 'http://example.com/annotations/12345'
Пример #2
0
    def test_get_passes_generators_annotation(self, registry):
        annotation = mock.Mock(id=12345)
        svc = LinksService(base_url="http://example.com", registry=registry)

        result = svc.get(annotation, "paramroute")

        assert result == "http://example.com/annotations/12345"
Пример #3
0
    def test_get_returns_link_text(self, registry):
        svc = LinksService(base_url="http://example.com", registry=registry)

        result = svc.get(mock.sentinel.annotation, "giraffe")

        assert result == "http://giraffes.com"
Пример #4
0
    def test_get_passes_generators_request_with_base_url(self, registry):
        svc = LinksService(base_url="http://donkeys.com", registry=registry)

        result = svc.get(mock.sentinel.annotation, "namedroute")

        assert result == "http://donkeys.com/some/path"
Пример #5
0
    def test_get_returns_link_text_for_hidden_links(self, registry):
        svc = LinksService(base_url="http://example.com", registry=registry)

        result = svc.get(mock.sentinel.annotation, "kiwi")

        assert result == "http://kiwi.net"
Пример #6
0
    def test_get_passes_generators_request_with_base_url(self, registry):
        svc = LinksService(base_url='http://donkeys.com', registry=registry)

        result = svc.get(mock.sentinel.annotation, 'namedroute')

        assert result == 'http://donkeys.com/some/path'
Пример #7
0
    def test_get_returns_link_text_for_hidden_links(self, registry):
        svc = LinksService(base_url='http://example.com', registry=registry)

        result = svc.get(mock.sentinel.annotation, 'kiwi')

        assert result == 'http://kiwi.net'
Пример #8
0
    def test_get_returns_link_text(self, registry):
        svc = LinksService(base_url='http://example.com', registry=registry)

        result = svc.get(mock.sentinel.annotation, 'giraffe')

        assert result == 'http://giraffes.com'