Exemple #1
0
 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')
Exemple #2
0
 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'))
Exemple #3
0
    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')
Exemple #4
0
 def testProbeSucceeds(self):
   bs = bootstrap.ButlerBootstrap.probe(self.env)
   self.assertEqual(bs, bootstrap.ButlerBootstrap(
     project='test-project',
     prefix='foo/bar',
     streamserver_uri='fake:path'))