def test_main(): ambianic.server.CONFIG_FILE = 'test-config-no-pipelines.yaml' _dir = os.path.dirname(os.path.abspath(__file__)) os.environ['AMBIANIC_DIR'] = _dir t = threading.Thread(target=__main__.main, daemon=True) t.start() t.join(timeout=1) __main__.stop() t.join(timeout=3) assert not t.is_alive()
def test_main(my_dir): os.environ["AMBIANIC_DIR"] = my_dir config.clean() load_config(os.path.join(my_dir, "test-config-no-pipelines.yaml"), clean=True) t = threading.Thread(target=__main__.main, daemon=True) t.start() t.join(timeout=1) __main__.stop() t.join(timeout=3) assert not t.is_alive()
def test_main(): _dir = os.path.dirname(os.path.abspath(__file__)) os.environ['AMBIANIC_DIR'] = _dir config.clean() config.load_file(path=os.path.join(_dir, 'test-config-no-pipelines.yaml')) t = threading.Thread(target=__main__.main, daemon=True) t.start() t.join(timeout=1) __main__.stop() t.join(timeout=3) assert not t.is_alive()