merge bookmark @
This commit is contained in:
commit
50d7cb2a51
4 changed files with 277 additions and 150 deletions
|
|
@ -35,7 +35,7 @@ class LiberviaCliJson:
|
|||
def __call__(self, *args, **kwargs):
|
||||
args = self.subcommands + list(args)
|
||||
self.subcommands.clear()
|
||||
kwargs['output'] = 'json_raw'
|
||||
kwargs['output'] = 'json-raw'
|
||||
kwargs['_tty_out'] = False
|
||||
cmd = li(*args, **kwargs)
|
||||
return json.loads(cmd.stdout)
|
||||
|
|
@ -60,7 +60,7 @@ class LiberviaCliElt(LiberviaCliJson):
|
|||
def __call__(self, *args, **kwargs):
|
||||
args = self.subcommands + list(args)
|
||||
self.subcommands.clear()
|
||||
kwargs['output'] = 'xml_raw'
|
||||
kwargs['output'] = 'xml-raw'
|
||||
kwargs['_tty_out'] = False
|
||||
cmd = li(*args, **kwargs)
|
||||
return self.parser(cmd.stdout.decode().strip())
|
||||
|
|
@ -153,13 +153,13 @@ class Editor:
|
|||
|
||||
@pytest.fixture(scope="session")
|
||||
def li_json():
|
||||
"""Run li with "json_raw" output, and returns the parsed value"""
|
||||
"""Run li with "json-raw" output, and returns the parsed value"""
|
||||
return LiberviaCliJson()
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def li_elt():
|
||||
"""Run li with "xml_raw" output, and returns the parsed value"""
|
||||
"""Run li with "xml-raw" output, and returns the parsed value"""
|
||||
return LiberviaCliElt()
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -176,7 +176,7 @@ class TestLiberviaCliBlog:
|
|||
li.blog.edit(_env=editor.env)
|
||||
assert len(editor.original_content) == 0
|
||||
assert editor.new_content == payload_md
|
||||
items_data = li_json.blog.get(max=1)
|
||||
items_data = li_json.blog.get(max_items=1)
|
||||
last_item = items_data[0][0]
|
||||
last_item_id = last_item['id']
|
||||
assert last_item['content'] == "content in markdown"
|
||||
|
|
@ -187,7 +187,7 @@ class TestLiberviaCliBlog:
|
|||
li.blog.edit("--last-item", _env=editor.env)
|
||||
assert editor.original_content == payload_md
|
||||
assert editor.new_content == f"{payload_md} extended"
|
||||
items_data = li_json.blog.get(max=1)
|
||||
items_data = li_json.blog.get(max_items=1)
|
||||
last_item = items_data[0][0]
|
||||
# we check that the id hasn't been modified
|
||||
assert last_item['id'] == last_item_id
|
||||
|
|
|
|||
|
|
@ -94,9 +94,9 @@ class TestPhotos:
|
|||
click(album_link)
|
||||
wait_until(lambda: S("#file_drop").exists())
|
||||
wait_until(lambda: not S("#loading_screen").exists())
|
||||
drag_file("/src/sat/tests/_files/test_1.jpg", "drop photos here")
|
||||
drag_file("/src/libervia-backend/tests/_files/test_1.jpg", "drop photos here")
|
||||
wait_until(lambda: len(find_all(S("div.progress_finished")))==1)
|
||||
drag_file("/src/sat/tests/_files/test_2.jpg", "drop photos here")
|
||||
drag_file("/src/libervia-backend/tests/_files/test_2.jpg", "drop photos here")
|
||||
wait_until(lambda: len(find_all(S("div.progress_finished")))==2)
|
||||
assert S('img[alt="test_1.jpg"]').exists()
|
||||
assert S('img[alt="test_2.jpg"]').exists()
|
||||
|
|
|
|||
|
|
@ -158,19 +158,19 @@ def use_e2e_env():
|
|||
libervia_web_root_path = libervia_web_path.parent
|
||||
if (libervia_web_root_path / ".hg").is_dir():
|
||||
libervia_web_source = libervia_web_root_path
|
||||
libervia_web_target = "/src/libervia"
|
||||
libervia_web_target = "/src/libervia-web"
|
||||
else:
|
||||
libervia_web_source = libervia_web_path
|
||||
libervia_web_target = "/src/libervia/libervia"
|
||||
libervia_web_target = "/src/libervia-web/libervia"
|
||||
|
||||
sat_templates_path = Path(sat_templates.__file__).parent.resolve()
|
||||
sat_templates_root_path = sat_templates_path.parent
|
||||
if (sat_templates_root_path / ".hg").is_dir():
|
||||
sat_templates_source = sat_templates_root_path
|
||||
sat_templates_target = "/src/sat_templates"
|
||||
sat_templates_target = "/src/libervia-templates"
|
||||
else:
|
||||
sat_templates_source = sat_templates_path
|
||||
sat_templates_target = "/src/sat_templates/sat_templates"
|
||||
sat_templates_target = "/src/libervia-templates/sat_templates"
|
||||
|
||||
compose_e2e_path = docker_path / "docker-compose-e2e.yml"
|
||||
if not compose_e2e_path.is_file():
|
||||
|
|
@ -186,13 +186,13 @@ def use_e2e_env():
|
|||
volumes:
|
||||
- type: bind
|
||||
source: {backend_root_path}
|
||||
target: /src/sat
|
||||
target: /src/libervia-backend
|
||||
read_only: true
|
||||
web:
|
||||
volumes:
|
||||
- type: bind
|
||||
source: {backend_root_path}
|
||||
target: /src/sat
|
||||
target: /src/libervia-backend
|
||||
read_only: true
|
||||
- type: bind
|
||||
source: {libervia_web_source}
|
||||
|
|
@ -224,7 +224,7 @@ def use_e2e_env():
|
|||
docker_compose.up("-d")
|
||||
|
||||
p = docker_compose.exec(
|
||||
"-T", "--workdir", "/src/sat/tests", "backend",
|
||||
"-T", "--workdir", "/src/libervia-backend/tests", "backend",
|
||||
"pytest", "-o", "cache_dir=/tmp", *sys.argv[1:], color="yes",
|
||||
_in=sys.stdin, _out=live_out, _out_bufsize=0, _err=live_err, _err_bufsize=0,
|
||||
_bg=True
|
||||
|
|
|
|||
Loading…
Reference in a new issue