Ejemplo n.º 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'
Ejemplo n.º 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"
Ejemplo n.º 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"
Ejemplo n.º 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"
Ejemplo n.º 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"
Ejemplo n.º 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'
Ejemplo n.º 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'
Ejemplo n.º 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'