athenad: add getGithubUsername method (#28025)
* athenad: add getGithubUsername method * add test * order old-commit-hash: 09d25ad9997ae08c22a84310bec6e7d3821aa408
This commit is contained in:
@@ -517,6 +517,11 @@ def getSshAuthorizedKeys() -> str:
|
||||
return Params().get("GithubSshKeys", encoding='utf8') or ''
|
||||
|
||||
|
||||
@dispatcher.add_method
|
||||
def getGithubUsername() -> str:
|
||||
return Params().get("GithubUsername", encoding='utf8') or ''
|
||||
|
||||
|
||||
@dispatcher.add_method
|
||||
def getSimInfo():
|
||||
return HARDWARE.get_sim_info()
|
||||
|
||||
@@ -53,6 +53,7 @@ class MockParams():
|
||||
default_params = {
|
||||
"DongleId": b"0000000000000000",
|
||||
"GithubSshKeys": b"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC307aE+nuHzTAgaJhzSf5v7ZZQW9gaperjhCmyPyl4PzY7T1mDGenTlVTN7yoVFZ9UfO9oMQqo0n1OwDIiqbIFxqnhrHU0cYfj88rI85m5BEKlNu5RdaVTj1tcbaPpQc5kZEolaI1nDDjzV0lwS7jo5VYDHseiJHlik3HH1SgtdtsuamGR2T80q1SyW+5rHoMOJG73IH2553NnWuikKiuikGHUYBd00K1ilVAK2xSiMWJp55tQfZ0ecr9QjEsJ+J/efL4HqGNXhffxvypCXvbUYAFSddOwXUPo5BTKevpxMtH+2YrkpSjocWA04VnTYFiPG6U4ItKmbLOTFZtPzoez private", # noqa: E501
|
||||
"GithubUsername": b"commaci",
|
||||
"GsmMetered": True,
|
||||
"AthenadUploadQueue": '[]',
|
||||
}
|
||||
|
||||
@@ -377,6 +377,10 @@ class TestAthenadMethods(unittest.TestCase):
|
||||
keys = dispatcher["getSshAuthorizedKeys"]()
|
||||
self.assertEqual(keys, MockParams().params["GithubSshKeys"].decode('utf-8'))
|
||||
|
||||
def test_getGithubUsername(self):
|
||||
keys = dispatcher["getGithubUsername"]()
|
||||
self.assertEqual(keys, MockParams().params["GithubUsername"].decode('utf-8'))
|
||||
|
||||
def test_getVersion(self):
|
||||
resp = dispatcher["getVersion"]()
|
||||
keys = ["version", "remote", "branch", "commit"]
|
||||
|
||||
Reference in New Issue
Block a user