-
Notifications
You must be signed in to change notification settings - Fork 248
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test_: create private group tests (#6225)
* test_: create private group tests * test_: set privileged False for jenkins * test_: run baseline tests in rpc suite * test_: address review comments * test_: address review comments
- Loading branch information
Showing
10 changed files
with
308 additions
and
157 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
from clients.rpc import RpcClient | ||
from clients.services.service import Service | ||
|
||
|
||
class AccountService(Service): | ||
def __init__(self, client: RpcClient): | ||
super().__init__(client, "accounts") | ||
|
||
def get_accounts(self): | ||
response = self.rpc_request("getAccounts") | ||
return response.json() | ||
|
||
def get_account_keypairs(self): | ||
response = self.rpc_request("getKeypairs") | ||
return response.json() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
from clients.rpc import RpcClient | ||
from clients.services.service import Service | ||
|
||
|
||
class SettingsService(Service): | ||
def __init__(self, client: RpcClient): | ||
super().__init__(client, "settings") | ||
|
||
def get_settings(self): | ||
response = self.rpc_request("getSettings") | ||
return response.json() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
from clients.rpc import RpcClient | ||
from clients.services.service import Service | ||
|
||
|
||
class WakuextService(Service): | ||
def __init__(self, client: RpcClient): | ||
super().__init__(client, "wakuext") | ||
|
||
def send_contact_request(self, contact_id: str, message: str): | ||
params = [{"id": contact_id, "message": message}] | ||
response = self.rpc_request("sendContactRequest", params) | ||
return response.json() | ||
|
||
def accept_contact_request(self, request_id: str): | ||
params = [{"id": request_id}] | ||
response = self.rpc_request("acceptContactRequest", params) | ||
return response.json() | ||
|
||
def get_contacts(self): | ||
response = self.rpc_request("contacts") | ||
return response.json() | ||
|
||
def send_message(self, contact_id: str, message: str): | ||
params = [{"id": contact_id, "message": message}] | ||
response = self.rpc_request("sendOneToOneMessage", params) | ||
return response.json() | ||
|
||
def start_messenger(self): | ||
response = self.rpc_request("startMessenger") | ||
json_response = response.json() | ||
|
||
if "error" in json_response: | ||
assert json_response["error"]["code"] == -32000 | ||
assert json_response["error"]["message"] == "messenger already started" | ||
return | ||
|
||
def create_group_chat_with_members(self, pubkey_list: list, group_chat_name: str): | ||
params = [None, group_chat_name, pubkey_list] | ||
response = self.rpc_request("createGroupChatWithMembers", params) | ||
return response.json() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.