Skip to content

Commit a363d9b

Browse files
committed
adds a deeplink to sota and pota websites
1 parent e61bdc3 commit a363d9b

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

function_app.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ def create_spot_deeplink(source, fullCallsign, wwffRef):
4343

4444
match source:
4545
case "sotawatch":
46-
return "[See their latest spot](https://sotl.as/activators/{fullCallsign})"
46+
return f"[See their latest spot](https://sotl.as/activators/{fullCallsign})"
4747
case "pota":
48-
return "[See their latest spot](https://api.pota.app/spot/comments/{fullCallsign}/{wwffRef})"
48+
return f"[See their latest spot](https://api.pota.app/spot/comments/{fullCallsign}/{wwffRef})"
4949
case _:
5050
return ""

test.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@ class TestSpotBot(unittest.TestCase):
66
def test_function_app_basic(self):
77
req_body = {"fullCallsign": "KI7HSG", "source": "pota", "frequency": "14.074", "mode": "FT8", "wwffRef":"US-0052"}
88
content = function_app.create_content(req_body)
9-
expected = {'content': 'KI7HSG | pota | freq: 14.074 | mode: FT8 | loc: US-0052'}
9+
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}
1010
self.assertDictEqual(content, expected)
1111

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

1818
if __name__ == '__main__':

0 commit comments

Comments
 (0)