コード例 #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')
コード例 #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'))
コード例 #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')
コード例 #4
0
ファイル: bootstrap_test.py プロジェクト: favorer/proto-quic
 def testProbeSucceeds(self):
   bs = bootstrap.ButlerBootstrap.probe(self.env)
   self.assertEqual(bs, bootstrap.ButlerBootstrap(
     project='test-project',
     prefix='foo/bar',
     streamserver_uri='fake:path'))