mirror of
https://github.com/onionshare/onionshare.git
synced 2025-01-25 10:42:58 -03:00
removed test_tails_appends_to_path because that no longer happens. changed test_get_platform_returns_env_var to test_get_platform_on_tails, because now it checks platform.uname()
This commit is contained in:
parent
51c487f30d
commit
6699a6285c
1 changed files with 4 additions and 12 deletions
|
@ -1,24 +1,16 @@
|
|||
from onionshare import *
|
||||
import tempfile
|
||||
|
||||
def test_get_platform_returns_env_var():
|
||||
"get_platform() returns ONIONSHARE_PLATFORM from the environment"
|
||||
os.environ['ONIONSHARE_PLATFORM'] = 'TI-83+'
|
||||
assert get_platform() == 'TI-83+'
|
||||
def test_get_platform_on_tails():
|
||||
"get_platform() returns 'Tails' when hostname is 'amnesia'"
|
||||
onionshare.platform.uname = lambda: ('Linux', 'amnesia', '3.14-1-amd64', '#1 SMP Debian 3.14.4-1 (2014-05-13)', 'x86_64', '')
|
||||
assert get_platform() == 'Tails'
|
||||
|
||||
def test_get_platform_returns_platform_system():
|
||||
"get_platform() returns platform.system() when ONIONSHARE_PLATFORM is not defined"
|
||||
os.environ.pop('ONIONSHARE_PLATFORM', None)
|
||||
onionshare.platform.system = lambda: 'Sega Saturn'
|
||||
assert get_platform() == 'Sega Saturn'
|
||||
|
||||
def test_tails_appends_to_path():
|
||||
"adds '/../tails/lib' to the path when running on Tails"
|
||||
original_path = sys.path
|
||||
onionshare.platform.system = lambda: 'Tails'
|
||||
append_lib_on_tails()
|
||||
assert sys.path[-1][-13:] == '/../tails/lib'
|
||||
|
||||
def test_get_hidden_service_dir_windows_with_temp():
|
||||
"get_hidden_service_dir() uses a directory from the Windows environment when defined"
|
||||
onionshare.platform.system = lambda: 'Windows'
|
||||
|
|
Loading…
Add table
Reference in a new issue