def testCreateStreamClientNoNamespace(self): bs = bootstrap.ButlerBootstrap(project='test-project', prefix='foo/bar', streamserver_uri='test:', coordinator_host='example.appspot.com', namespace='') sc = bs.stream_client(reg=self.reg) self.assertEqual(sc.open_text('foobar').params.name, 'foobar')
def testProbeSucceeds(self): bs = bootstrap.ButlerBootstrap.probe(self.env) self.assertEqual( bs, bootstrap.ButlerBootstrap(project='test-project', prefix='foo/bar', streamserver_uri='fake:path', coordinator_host='example.appspot.com'))
def testCreateStreamClient(self): class TestStreamClient(stream.StreamClient): @classmethod def _create(cls, _value, **kwargs): return cls(**kwargs) def _connect_raw(self): raise NotImplementedError() reg = stream.StreamProtocolRegistry() reg.register_protocol('test', TestStreamClient) bs = bootstrap.ButlerBootstrap(project='test-project', prefix='foo/bar', streamserver_uri='test:', coordinator_host='example.appspot.com') sc = bs.stream_client(reg=reg) self.assertEqual(sc.prefix, 'foo/bar') self.assertEqual(sc.coordinator_host, 'example.appspot.com')
def testProbeSucceeds(self): bs = bootstrap.ButlerBootstrap.probe(self.env) self.assertEqual(bs, bootstrap.ButlerBootstrap( project='test-project', prefix='foo/bar', streamserver_uri='fake:path'))