code: def test_http():
      requests = pytest.importorskip("requests")
      port = 9875
      s = Source.from_http_server(port)
      out = s.sink_to_list()
      s.start()
      wait_for(lambda: s.server is not None, 2, period=0.02)
  
      r = requests.post("http://localhost:%i/" % port, data=b"data")
      wait_for(lambda: out == [b"data"], 2, period=0.01)
      assert r.ok
  
      r = requests.post(
          "http://localhost:%i/other" % port, data=b"data2"
      )
      wait_for(lambda: out == [b"data", b"data2"], 2, period=0.01)
      assert r.ok
  
      s.stop()
  
      with pytest.raises(requests.exceptions.RequestException):
          requests.post(
              "http://localhost:%i/other" % port, data=b"data2"
          )
  
file_path: streamz/streamz/tests/test_sources.py
imports: import asyncio
  import sys
  from flaky import flaky
  import pytest
  from streamz import Source
  from streamz.utils_test import wait_for, await_for, gen_test
  import socket
label_desc: Use image node_id 4 for calling a global function with example usage: test_http() without return types