Remove unneeded argument
Instead, figure out the data directory from the helpers directory.
This commit is contained in:
parent
4a1ba45efa
commit
e0e8bc805b
@ -104,13 +104,11 @@ def pattern_match(*, pattern, value):
|
|||||||
return re.fullmatch(re_pattern, value) is not None
|
return re.fullmatch(re_pattern, value) is not None
|
||||||
|
|
||||||
|
|
||||||
def abs_datapath(from_file):
|
def abs_datapath():
|
||||||
"""Get the absolute datapath.
|
"""Get the absolute path to the integration data directory.
|
||||||
|
|
||||||
__FILE__ must be given as an argument
|
|
||||||
|
|
||||||
Return:
|
Return:
|
||||||
The absolute path to the tests/integration/data directory.
|
The absolute path to the tests/integration/data directory.
|
||||||
"""
|
"""
|
||||||
file_abs = os.path.abspath(os.path.dirname(from_file))
|
file_abs = os.path.abspath(os.path.dirname(__file__))
|
||||||
return os.path.join(file_abs, '..', 'data')
|
return os.path.join(file_abs, '..', 'integration', 'data')
|
||||||
|
@ -140,10 +140,10 @@ def run_userscript(quteproc, userscript):
|
|||||||
Wrapper around :spawn --userscript {userscript} that uses an absolute
|
Wrapper around :spawn --userscript {userscript} that uses an absolute
|
||||||
path.
|
path.
|
||||||
"""
|
"""
|
||||||
abs_userscript_path = os.path.join(utils.abs_datapath(__file__),
|
abs_userscript_path = os.path.join(utils.abs_datapath(),
|
||||||
'userscripts', userscript)
|
'userscripts', userscript)
|
||||||
|
|
||||||
cmd = ':spawn --userscript "{abs_userscript_path}"'
|
cmd = ':spawn --userscript {abs_userscript_path}'
|
||||||
quteproc.send_cmd(cmd.format(abs_userscript_path=abs_userscript_path))
|
quteproc.send_cmd(cmd.format(abs_userscript_path=abs_userscript_path))
|
||||||
|
|
||||||
|
|
||||||
@ -349,7 +349,7 @@ def check_contents(quteproc, filename):
|
|||||||
The filename is interpreted relative to tests/integration/data.
|
The filename is interpreted relative to tests/integration/data.
|
||||||
"""
|
"""
|
||||||
content = quteproc.get_content(plain=False)
|
content = quteproc.get_content(plain=False)
|
||||||
path = os.path.join(utils.abs_datapath(__file__),
|
path = os.path.join(utils.abs_datapath(),
|
||||||
os.path.join(*filename.split('/')))
|
os.path.join(*filename.split('/')))
|
||||||
with open(path, 'r', encoding='utf-8') as f:
|
with open(path, 'r', encoding='utf-8') as f:
|
||||||
file_content = f.read()
|
file_content = f.read()
|
||||||
|
Loading…
Reference in New Issue
Block a user