Пример #1
0
    def test_etcd_resolve_nonexisting(self):
        etcd_client_mock = FakeEtcdClient(self.etcd_content)
        uuid = "apache-uuid-1"

        resolver = ServiceInstanceNameResolver(etcd_client_mock)
        result = resolver.resolve("nonexisting")
        assert result is None
Пример #2
0
    def test_etcd_resolve_with_dot_service_ending(self):
        etcd_client_mock = FakeEtcdClient(self.etcd_content)
        uuid = "apache-uuid-3"

        resolver = ServiceInstanceNameResolver(etcd_client_mock)
        result = resolver.resolve(uuid)
        expected_result = "apache_instance_name_3.service"
        assert result == expected_result