Ejemplo n.º 1
0
 def test_get_stream(self):
     stream = StreamFactory()
     response = self.fetch(stream.absolute_url())
     eq_(response.code, 200)
     result = json.loads(response.body)
     ok_('stream' in result)
     eq_(result['stream']['slug'], stream.slug)
     eq_(result['stream']['name'], stream.name)
Ejemplo n.º 2
0
 def test_get_streams(self):
     Node.me()
     [StreamFactory() for _ in range(3)]
     response = self.fetch('/streams')
     eq_(response.code, 200)
     result = json.loads(response.body)
     ok_('streams' in result)
     for stream in result['streams']:
         ok_(Stream.get_by(name=stream['name']))
Ejemplo n.º 3
0
 def test_resume_stream(self):
     stream = StreamFactory()
     session.commit()
     data = {'streaming': True}
     eq_(stream.streaming, False)
     self.http_client.fetch(
         HTTPRequest(self.get_url(stream.absolute_url()),
                     'PUT',
                     body=json.dumps(data)), self.stop)
     response = self.wait()
     eq_(response.code, 200)
     eq_(stream.streaming, True)