tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

test_wait.py (863B)


      1 #!/usr/bin/env python
      2 # This Source Code Form is subject to the terms of the Mozilla Public
      3 # License, v. 2.0. If a copy of the MPL was not distributed with this file,
      4 # You can obtain one at http://mozilla.org/MPL/2.0/.
      5 
      6 import mozunit
      7 
      8 
      9 def test_wait_while_running(runner):
     10    """Wait for the process while it is running"""
     11    runner.start()
     12    returncode = runner.wait(1)
     13 
     14    assert runner.is_running()
     15    assert returncode is None
     16    assert runner.returncode == returncode
     17    assert runner.process_handler is not None
     18 
     19 
     20 def test_wait_after_process_finished(runner):
     21    """Bug 965714: wait() after stop should not raise an error"""
     22    runner.start()
     23    runner.process_handler.kill()
     24 
     25    returncode = runner.wait(1)
     26 
     27    assert returncode not in [None, 0]
     28    assert runner.process_handler is not None
     29 
     30 
     31 if __name__ == "__main__":
     32    mozunit.main()