added headed argument to more robustly handle issues with scrapers headless mode

This commit is contained in:
Tristan Lee
2023-09-19 16:30:13 -05:00
parent 0bd87f944e
commit 89d89521fa
5 changed files with 53 additions and 10 deletions

View File

@@ -20,6 +20,7 @@ PARSER_ARGUMENTS = [
("table", True, "--table"),
("table", True, "-t"),
("verbose", True, "--verbose"),
("headed", True, "--headed"),
("verbose", True, "-v"),
("output_dir", "/tmp/tiktok_download", "--output-dir"),
("config", "~/.tiktok", "--config"),
@@ -51,6 +52,7 @@ def test_output_dir_spec_noexist_nowrite(tmp_path):
specified_output_dir=specified_output_dir, parser=parser
)
assert system_exit.type == SystemExit
os.chmod(tmp_path, 0o666)
def test_output_dir_spec_exist_nowrite(tmp_path):
@@ -63,6 +65,7 @@ def test_output_dir_spec_exist_nowrite(tmp_path):
specified_output_dir=specified_output_dir, parser=parser
)
assert system_exit.type == SystemExit
os.chmod(tmp_path, 0o666)
def test_output_dir_unspec_nowrite(monkeypatch, tmp_path):
@@ -75,6 +78,7 @@ def test_output_dir_unspec_nowrite(monkeypatch, tmp_path):
result = process_output_dir(specified_output_dir=None, parser=parser)
monkeypatch.chdir(cwd)
assert result == DEFAULT_OUTPUT_DIR
os.chmod(tmp_path, 0o666)
def test_output_dir_spec_noexist_write(tmp_path):