mirror of
https://github.com/onionshare/onionshare.git
synced 2025-05-06 00:15:11 -04:00
split tests into multiple files, and fixed tests to work with refactor
This commit is contained in:
parent
54a37ee28e
commit
a32ca2f7a9
5 changed files with 103 additions and 83 deletions
21
test/test_helpers.py
Normal file
21
test/test_helpers.py
Normal file
|
@ -0,0 +1,21 @@
|
|||
import tempfile
|
||||
|
||||
class MockSubprocess():
|
||||
def __init__(self):
|
||||
self.last_call = None
|
||||
|
||||
def call(self, args):
|
||||
self.last_call = args
|
||||
|
||||
def last_call_args(self):
|
||||
return self.last_call
|
||||
|
||||
def write_tempfile(text):
|
||||
tempdir = tempfile.mkdtemp()
|
||||
path = tempdir + "/test-file.txt"
|
||||
with open(path, "w") as f:
|
||||
f.write(text)
|
||||
f.close()
|
||||
return path
|
||||
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue