def __test():
    """
  ### test Cmd capture
  >>> out, err, status = Sh('echo -n bar >&2; echo -n foo; exit 1').capture(1, 2)
  >>> out.read()
  'foo'
  >>> err.read()
  'bar'
  >>> status
  1
  
  ### test Cmd simple {2: 1} redirection
  >>> sh('echo -n foo; echo -n bar >&2', {2: 1})
  'foobar'
  
  ### test Cmd ENV
  >>> sh('echo -n $var', e={'var': 'foobar'})
  'foobar'
  
  ### test Cmd redirect {1: n}
  >>> f = tempfile.TemporaryFile()
  >>> Sh('echo -n foo', {1: f.fileno()}).run()
  0
  >>> f.seek(0); f.read()
  'foo'
  
  ### test Cmd unsupported redirect that should really be supported
  >>> sh('echo -n foo; echo -n bar >&2', {1: 2})
  Traceback (most recent call last):
  ...
  NotImplementedError: redirection {1: 2} not supported
  
  ### test Cmd unsupported redirect
  >>> sh('echo -n foo; echo -n bar >&2', {5: 12})
  Traceback (most recent call last):
  ...
  NotImplementedError: redirection {5: 12} not supported
  
  ### test Cmd impossible capture
  >>> sh("echo bogus stuff", {1: os.devnull}) #doctest: +ELLIPSIS
  Traceback (most recent call last):
  ...
  ValueError: cannot capture ...
  
  ### test Pipe stderr capture
  >>> Pipe(Sh('echo -n foo; sleep 0.01; echo -n bar >&2'), Sh('cat >&2')).capture(2).stderr.read()
  'foobar'
  
  ### test Pipe ENV
  >>> pipe(Sh('echo -n $x'), Sh('cat; echo -n $x'), e=dict(x='foobar'))
  'foobarfoobar'
  
  ### test Pipe impossible capture
  >>> pipe(Sh("echo bogus"), Cmd("cat", {1: os.devnull})) #doctest: +ELLIPSIS
  Traceback (most recent call last):
  ...
  ValueError: cannot capture ...
  
  ### test Pipe pathetic case
  >>> pipe(Sh("echo -n foo"), Cmd("cat", {0: here("bar")}))
  'bar'
  
  ### test JOBS
  >>> Pipe(Cmd('yes'), Cmd('cat', {1: os.devnull})).spawn() #doctest: +ELLIPSIS
  Pipe(...
  >>> JOBS[-1].cmd[0].p.kill()
  >>> JOBS[-1].cmd[-1].p.wait()
  0
  """
    pass
