示例#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'