Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ authors = [{ name = "Mycli Core Team", email = "[email protected]" }]
urls = { homepage = "http://mycli.net" }

dependencies = [
"click >= 7.0,<8.1.8",
"click >= 7.0",
"cryptography >= 1.0.0",
"Pygments>=1.6",
"prompt_toolkit>=3.0.6,<4.0.0",
Expand Down
36 changes: 31 additions & 5 deletions test/features/environment.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# type: ignore

import os
Expand Down Expand Up @@ -27,6 +27,27 @@
return context.config.userdata.get("my_test_db", None) or "mycli_behave_tests"


WRAPPAGER_TEMPLATE = """\
#!{sys_executable}
import os
import sys


def wrappager(boundary):
print(boundary)
while 1:
buf = sys.stdin.read(2048)
if not buf:
break
sys.stdout.write(buf)
print(boundary)


if __name__ == "__main__":
wrappager({pager_boundary})
"""


def before_all(context):
"""Set env parameters."""
os.environ["LINES"] = "100"
Expand Down Expand Up @@ -64,13 +85,18 @@
"pager_boundary": "---boundary---",
}

wrappager_fd, wrappager = mkstemp()
with open(wrappager, "w") as f:
f.write(WRAPPAGER_TEMPLATE.format(
sys_executable=sys.executable,
pager_boundary=repr(context.conf["pager_boundary"]),
))
os.close(wrappager_fd)
os.chmod(wrappager, 0o755)

_, my_cnf = mkstemp()
with open(my_cnf, "w") as f:
f.write(
"[client]\npager={0} {1} {2}\n".format(
sys.executable, os.path.join(context.package_root, "test/features/wrappager.py"), context.conf["pager_boundary"]
)
)
f.write("[client]\npager={0}\n".format(wrappager))
context.conf["defaults-file"] = my_cnf
context.conf["myclirc"] = os.path.join(context.package_root, "test", "myclirc")

Expand Down
17 changes: 0 additions & 17 deletions test/features/wrappager.py

This file was deleted.

Loading