diff --git a/tests/schema/WebAppData.json b/tests/schema/WebAppData.json new file mode 100644 index 0000000..d56fb1b --- /dev/null +++ b/tests/schema/WebAppData.json @@ -0,0 +1,4 @@ +{ + "data": "{'foo': 'bar'}", + "button_text": "Button text" +} \ No newline at end of file diff --git a/tests/test_types.py b/tests/test_types.py index 94668bd..89a3c55 100644 --- a/tests/test_types.py +++ b/tests/test_types.py @@ -784,6 +784,18 @@ def test_venue_location(self): self.assertEqual(location.proximity_alert_radius, 20) +class TestWebAppData(unittest.TestCase): + with open("schema/WebAppData.json") as f: + data = f.read() + + object = types.WebAppData.de_json(data) + + def test_web_app_data(self): + web_app_data = self.object + self.assertEqual(web_app_data.data, "{'foo': 'bar'}") + self.assertEqual(web_app_data.button_text, "Button text") + + class TestProximityAlertTriggered(unittest.TestCase): with open("schema/ProximityAlertTriggered.json") as f: data = f.read()