Fix CLI tests

This commit is contained in:
Micah Lee 2021-10-15 09:21:58 -07:00
parent 2ffd15ae82
commit 64973a00ec
No known key found for this signature in database
GPG key ID: 403C2657CD994F73
2 changed files with 11 additions and 1 deletions

View file

@ -162,11 +162,15 @@ class TestGetTorPaths:
tor_geo_ip_file_path = os.path.join(base_path, "Resources", "Tor", "geoip") tor_geo_ip_file_path = os.path.join(base_path, "Resources", "Tor", "geoip")
tor_geo_ipv6_file_path = os.path.join(base_path, "Resources", "Tor", "geoip6") tor_geo_ipv6_file_path = os.path.join(base_path, "Resources", "Tor", "geoip6")
obfs4proxy_file_path = os.path.join(base_path, "Resources", "Tor", "obfs4proxy") obfs4proxy_file_path = os.path.join(base_path, "Resources", "Tor", "obfs4proxy")
snowflake_file_path = os.path.join(
base_path, "Resources", "Tor", "snowflake-client"
)
assert common_obj.get_tor_paths() == ( assert common_obj.get_tor_paths() == (
tor_path, tor_path,
tor_geo_ip_file_path, tor_geo_ip_file_path,
tor_geo_ipv6_file_path, tor_geo_ipv6_file_path,
obfs4proxy_file_path, obfs4proxy_file_path,
snowflake_file_path,
) )
@pytest.mark.skipif(sys.platform != "linux", reason="requires Linux") @pytest.mark.skipif(sys.platform != "linux", reason="requires Linux")
@ -176,6 +180,7 @@ class TestGetTorPaths:
tor_geo_ip_file_path, tor_geo_ip_file_path,
tor_geo_ipv6_file_path, tor_geo_ipv6_file_path,
_, # obfs4proxy is optional _, # obfs4proxy is optional
_, # snowflake-client is optional
) = common_obj.get_tor_paths() ) = common_obj.get_tor_paths()
assert os.path.basename(tor_path) == "tor" assert os.path.basename(tor_path) == "tor"
@ -199,6 +204,9 @@ class TestGetTorPaths:
obfs4proxy_file_path = os.path.join( obfs4proxy_file_path = os.path.join(
os.path.join(base_path, "Tor"), "obfs4proxy.exe" os.path.join(base_path, "Tor"), "obfs4proxy.exe"
) )
snowflake_file_path = os.path.join(
os.path.join(base_path, "Tor"), "snowflake-client.exe"
)
tor_geo_ip_file_path = os.path.join( tor_geo_ip_file_path = os.path.join(
os.path.join(os.path.join(base_path, "Data"), "Tor"), "geoip" os.path.join(os.path.join(base_path, "Data"), "Tor"), "geoip"
) )
@ -210,6 +218,7 @@ class TestGetTorPaths:
tor_geo_ip_file_path, tor_geo_ip_file_path,
tor_geo_ipv6_file_path, tor_geo_ipv6_file_path,
obfs4proxy_file_path, obfs4proxy_file_path,
snowflake_file_path,
) )

View file

@ -32,9 +32,10 @@ class TestSettings:
"no_bridges": True, "no_bridges": True,
"tor_bridges_use_obfs4": False, "tor_bridges_use_obfs4": False,
"tor_bridges_use_meek_lite_azure": False, "tor_bridges_use_meek_lite_azure": False,
"tor_bridges_use_snowflake": False,
"tor_bridges_use_custom_bridges": "", "tor_bridges_use_custom_bridges": "",
"persistent_tabs": [], "persistent_tabs": [],
"theme":0 "theme": 0,
} }
for key in settings_obj._settings: for key in settings_obj._settings:
# Skip locale, it will not always default to the same thing # Skip locale, it will not always default to the same thing