def test_main(tmp_path, mocker): """Test invocation from command line""" os.chdir(tmp_path) assert subprocess.check_output(["interp_relperm", "-h"]) test_cfg = TESTDATA / "cfg.yml" mocker.patch("sys.argv", [__file__, "-c", str(test_cfg), "-r", str(TESTDATA)]) interp_relperm.main() assert Path("outfile.inc").exists()
def test_main(tmpdir): """Test invocation from command line""" tmpdir.chdir() assert os.system("interp_relperm -h") == 0 test_cfg = os.path.join(str(TESTDATA), "cfg.yml") sys.argv = [__file__, "-c", test_cfg, "-r", str(TESTDATA)] interp_relperm.main() assert os.path.exists("outfilen.inc")
def test_args(tmpdir): """Test that we can parse args on the command line""" tmpdir.chdir() test_cfg = os.path.join(str(TESTDATA), "cfg.yml") sys.argv = [ __file__, "--configfile", test_cfg, "--root-path", str(TESTDATA) ] interp_relperm.main() assert os.path.exists("outfilen.inc")
def test_args(tmp_path, mocker): """Test that we can parse args on the command line""" os.chdir(tmp_path) test_cfg = TESTDATA / "cfg.yml" mocker.patch( "sys.argv", [__file__, "--configfile", str(test_cfg), "--root-path", str(TESTDATA)], ) interp_relperm.main() assert Path("outfile.inc").exists()