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'
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"
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"
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"
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"
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'
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'
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'