Files
Igor Sirotin b7ba8e52d6 refactor: move test suites under test/
tests-functional/    -> test/functional/
  tests-unit-network/  -> test/unit-network/

No Go code changes beyond the two package paths. Every reference follows:
Makefile targets, the pytest-lint and reliability workflows, the three
Jenkinsfiles, the root Dockerfile, pyrightconfig.json, .gitignore, the
benchmark and functional-test scripts, and the docs.

All paths inside the moved directories are self-contained (docker compose
uses `context: .`, the Python helpers resolve from __file__), so the extra
level of nesting does not reach outside.

refs #7067
2026-08-20 20:59:45 +02:00

25 lines
859 B
Python

import pytest
from clients.services.linkpreview import URLUnfurlPermission
from steps import messenger
@pytest.mark.rpc
class TestLinkPreview:
def test_contact_link_preview(self, backend_new_profile):
user_1 = backend_new_profile("user_1")
user_2 = backend_new_profile("user_2")
messenger.make_contacts(user_1, user_2)
user_1_url = user_1.sharedurls_service.share_user_url_with_data(user_1.public_key)
text = f"Here's my shared URL: {user_1_url}"
plan = user_1.linkpreview_service.get_text_urls_to_unfurl(text)
assert plan is not None
assert len(plan["urls"]) == 1
metadata = plan["urls"][0]
assert metadata["url"] == user_1_url
assert metadata["isStatusSharedURL"] is True
assert metadata["permission"] is URLUnfurlPermission.URLUnfurlingAllowed.value