Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix bad implementation of set_auto_accept_follow on FediverseNode #389

Merged
merged 1 commit into from
Oct 15, 2024
Merged
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
7 changes: 3 additions & 4 deletions src/feditest/nodedrivers/mastodon/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -264,8 +264,6 @@ def __init__(self, rolename: str, config: NodeConfiguration, account_manager: Ac
# The request.Session with the custom certificate authority set as verifier.
# Allocated when needed, so our custom certificate authority has been created before this is used.

self._auto_accept_follow = auto_accept_follow # True is default for Mastodon


# From FediverseNode

Expand Down Expand Up @@ -333,8 +331,9 @@ def make_follow(self, actor_acct_uri: str, to_follow_actor_acct_uri: str) -> Non

# Python 3.12 @override
def set_auto_accept_follow(self, actor_acct_uri: str, auto_accept_follow: bool = True) -> None:
if self._auto_accept_follow == auto_accept_follow:
return
if auto_accept_follow:
return # Default for Mastodon

raise NotImplementedByNodeError(self, NodeWithMastodonAPI.set_auto_accept_follow) # Can't find an API call for this


Expand Down
3 changes: 3 additions & 0 deletions src/feditest/protocols/fediverse/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,9 @@ def set_auto_accept_follow(self, actor_acct_uri: str, auto_accept_follow: bool =
if they do not have the requested behavior (or it cannot be scripted) and
the corresponding tests does not run.
"""
if auto_accept_follow:
return # Assumed default

raise NotImplementedByNodeError(self, FediverseNode.set_auto_accept_follow)


Expand Down
2 changes: 1 addition & 1 deletion tests.smoke/tests/nodes_with_mastodon_api_communicate.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ def __init__(self,
) -> None:
self.leader_node = leader_node
self.leader_actor_acct_uri = None
self.leader_node.set_auto_accept_follow(True)

self.follower_node = follower_node
self.follower_actor_acct_uri = None
Expand All @@ -29,6 +28,7 @@ def __init__(self,
def provision_actors(self):
self.leader_actor_acct_uri = self.leader_node.obtain_actor_acct_uri()
assert self.leader_actor_acct_uri
self.leader_node.set_auto_accept_follow(self.leader_actor_acct_uri, True)

self.follower_actor_acct_uri = self.follower_node.obtain_actor_acct_uri()
assert self.follower_actor_acct_uri
Expand Down
Loading