qutebrowser profile manager
at 1.0-rc2 34 lines 1.1 kB view raw
1from os import environ 2from pathlib import Path 3 4from click.testing import CliRunner 5 6from qbpm.main import main 7 8 9def test_profile_dir_option(tmp_path: Path): 10 runner = CliRunner() 11 result = runner.invoke(main, ["-P", str(tmp_path), "new", "test"]) 12 assert result.exit_code == 0 13 assert result.output.strip() == str(tmp_path / "test") 14 assert list(tmp_path.iterdir()) == [tmp_path / "test"] 15 16 17def test_profile_dir_env(tmp_path: Path): 18 environ["QBPM_PROFILE_DIR"] = str(tmp_path) 19 runner = CliRunner() 20 result = runner.invoke(main, ["new", "test"]) 21 assert result.exit_code == 0 22 assert result.output.strip() == str(tmp_path / "test") 23 assert list(tmp_path.iterdir()) == [tmp_path / "test"] 24 25 26def test_from_session(tmp_path: Path): 27 environ["QBPM_PROFILE_DIR"] = str(tmp_path) 28 session = tmp_path / "test.yml" 29 session.touch() 30 runner = CliRunner() 31 result = runner.invoke(main, ["from-session", str(session)]) 32 assert result.exit_code == 0 33 assert result.output.strip() == str(tmp_path / "test") 34 assert set(tmp_path.iterdir()) == {session, tmp_path / "test"}