Fix unit tests

main
Bob Mottram 2023-10-16 21:44:29 +01:00
parent 756c2475ef
commit 8f65f6c709
2 changed files with 12 additions and 10 deletions

View File

@ -63,7 +63,7 @@ from follow import clear_follows
from follow import add_follower_of_person
from follow import send_follow_request_via_server
from follow import send_unfollow_request_via_server
# from tests import test_shared_items_federation
from tests import test_shared_items_federation
from tests import test_group_follow
from tests import test_post_message_between_servers
from tests import test_follow_between_servers
@ -820,7 +820,7 @@ def _command_options() -> None:
if argb.testsnetwork:
print('Network Tests')
base_dir = os.getcwd()
# test_shared_items_federation(base_dir)
test_shared_items_federation(base_dir)
test_group_follow(base_dir)
test_post_message_between_servers(base_dir)
test_follow_between_servers(base_dir)

View File

@ -2837,13 +2837,14 @@ def send_post(signing_priv_key_pem: str, project_version: str,
# NOTE: the inbox domain being sent to isn't always the same
# as the destination instance domain. eg public-api.wordpress.com
# rather than the wordpress instance domain
inbox_url_domain, _ = get_domain_from_actor(inbox_url)
inbox_url_domain, inbox_url_port = get_domain_from_actor(inbox_url)
if inbox_url_domain:
if inbox_url_domain != to_domain:
inbox_domain = get_full_domain(inbox_url_domain, inbox_url_port)
if inbox_domain != to_domain:
print('send_post ' +
'inbox domain is not the same as instance domain ' +
inbox_url_domain + ' != ' + to_domain)
to_domain = inbox_url_domain
inbox_domain + ' != ' + to_domain)
to_domain = inbox_domain
if to_domain not in inbox_url:
return 7
@ -3271,13 +3272,14 @@ def send_signed_json(post_json_object: {}, session, base_dir: str,
# NOTE: the inbox domain being sent to isn't always the same
# as the destination instance domain. eg public-api.wordpress.com
# rather than the wordpress instance domain
inbox_url_domain, _ = get_domain_from_actor(inbox_url)
inbox_url_domain, inbox_url_port = get_domain_from_actor(inbox_url)
if inbox_url_domain:
if inbox_url_domain != to_domain:
inbox_domain = get_full_domain(inbox_url_domain, inbox_url_port)
if inbox_domain != to_domain:
print('send_signed_json ' +
'inbox domain is not the same as instance domain ' +
inbox_url_domain + ' != ' + to_domain)
to_domain = inbox_url_domain
inbox_domain + ' != ' + to_domain)
to_domain = inbox_domain
if to_domain not in inbox_url:
if debug: