Skip to content

Commit

Permalink
adds a deeplink to sota and pota websites
Browse files Browse the repository at this point in the history
  • Loading branch information
tblanarik committed Sep 21, 2024
1 parent e61bdc3 commit a363d9b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions function_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ def create_spot_deeplink(source, fullCallsign, wwffRef):

match source:
case "sotawatch":
return "[See their latest spot](https://sotl.as/activators/{fullCallsign})"
return f"[See their latest spot](https://sotl.as/activators/{fullCallsign})"
case "pota":
return "[See their latest spot](https://api.pota.app/spot/comments/{fullCallsign}/{wwffRef})"
return f"[See their latest spot](https://api.pota.app/spot/comments/{fullCallsign}/{wwffRef})"
case _:
return ""
4 changes: 2 additions & 2 deletions test.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ class TestSpotBot(unittest.TestCase):
def test_function_app_basic(self):
req_body = {"fullCallsign": "KI7HSG", "source": "pota", "frequency": "14.074", "mode": "FT8", "wwffRef":"US-0052"}
content = function_app.create_content(req_body)
expected = {'content': 'KI7HSG | pota | freq: 14.074 | mode: FT8 | loc: US-0052'}
expected = {'content': 'KI7HSG | pota | freq: 14.074 | mode: FT8 | loc: US-0052 | [See their latest spot](https://api.pota.app/spot/comments/KI7HSG/US-0052)', 'flags': 4}
self.assertDictEqual(content, expected)

def test_function_app(self):
req_body = {"fullCallsign": "KI7HSG", "source": "sotawatch", "frequency": "14.074", "mode": "FT8", "summitRef": "ABCD"}
content = function_app.create_content(req_body)
expected = {'content': 'KI7HSG | sotawatch | freq: 14.074 | mode: FT8 | loc: ABCD'}
expected = {'content': 'KI7HSG | sotawatch | freq: 14.074 | mode: FT8 | loc: ABCD | [See their latest spot](https://sotl.as/activators/KI7HSG)', 'flags': 4}
self.assertDictEqual(content, expected)

if __name__ == '__main__':
Expand Down

0 comments on commit a363d9b

Please sign in to comment.