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

Memoise previous responses to prompt for account URIs #260

Merged
merged 1 commit into from
Jul 20, 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
4 changes: 4 additions & 0 deletions src/feditest/protocols/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,10 @@ def parameter(self, name:str) -> str | None:
return self._parameters.get(name)


def set_parameter(self, name:str, value:Any) -> None:
return self._parameters.update({name: value})


def __str__(self) -> str:
return f'"{ type(self).__name__}" in constellation role "{self.rolename}"'

Expand Down
2 changes: 2 additions & 0 deletions src/feditest/protocols/webfinger/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ def obtain_account_identifier(self, nickname: str | None = None) -> str:
self.parameter('existing-account-uri'),
http_https_acct_uri_validate)
assert ret
self.set_parameter('existing-account-uri', ret)
return ret


Expand All @@ -56,6 +57,7 @@ def obtain_non_existing_account_identifier(self, nickname: str | None = None ) -
self.parameter('nonexisting-account-uri'),
http_https_acct_uri_validate)
assert ret
self.set_parameter('nonexisting-account-uri', ret)
return ret


Expand Down