From 175a6d52277d321a93310dbe78d81a4ff68d2a10 Mon Sep 17 00:00:00 2001 From: Jack Lucas Date: Fri, 19 Apr 2019 15:14:25 -0400 Subject: Fix DR subscriber failure Issue-ID: DCAEGEN2-1009 Change-Id: Ieb770b6562123dda78fd4b8c8c514d30767ad7fb Signed-off-by: Jack Lucas --- k8s/tests/test_tasks.py | 29 +++-------------------------- 1 file changed, 3 insertions(+), 26 deletions(-) (limited to 'k8s/tests/test_tasks.py') diff --git a/k8s/tests/test_tasks.py b/k8s/tests/test_tasks.py index d56a443..933753a 100644 --- a/k8s/tests/test_tasks.py +++ b/k8s/tests/test_tasks.py @@ -174,21 +174,6 @@ def test_setup_for_discovery_streams(monkeypatch, mockconfig): with pytest.raises(NonRecoverableError): tasks._setup_for_discovery_streams(**test_input) - -def test_lookup_service(monkeypatch, mockconfig): - import k8splugin - from k8splugin import tasks - def fake_lookup(conn, scn): - return [{"ServiceAddress": "192.168.1.1", "ServicePort": "80"}] - - monkeypatch.setattr(k8splugin.discovery, "lookup_service", - fake_lookup) - - assert "192.168.1.1" == tasks._lookup_service("some-component") - assert "192.168.1.1:80" == tasks._lookup_service("some-component", - with_port=True) - - def test_verify_container(monkeypatch, mockconfig): import k8sclient from k8splugin import tasks @@ -222,20 +207,12 @@ def test_update_delivery_url(monkeypatch, mockconfig): {'type': 'data_router', 'name': 'feed01', 'username': 'hero', 'password': '123456', 'location': 'Bedminster', 'route': 'some-path'}], - 'topic01': {'type': 'message_router', 'name': 'topic01'}} + 'topic01': {'type': 'message_router', 'name': 'topic01'}, + 'ports': ['8080/tcp:0']} test_input["service_component_name"] = "some-foo-service-component" - def fake_lookup_service(name, with_port=False): - if with_port: - return "10.100.1.100:8080" - else: - return - - monkeypatch.setattr(k8splugin.tasks, "_lookup_service", - fake_lookup_service) - expected = copy.deepcopy(test_input) - expected["feed01"]["delivery_url"] = "http://10.100.1.100:8080/some-path" + expected["feed01"]["delivery_url"] = "http://some-foo-service-component:8080/some-path" assert tasks._update_delivery_url(**test_input) == expected -- cgit 1.2.3-korg