Skip to content

Commit

Permalink
Added test to the class WebAppData
Browse files Browse the repository at this point in the history
  • Loading branch information
MA24th committed May 9, 2022
1 parent 7861768 commit bd14200
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tests/schema/WebAppData.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"data": "{'foo': 'bar'}",
"button_text": "Button text"
}
12 changes: 12 additions & 0 deletions tests/test_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit bd14200

Please sign in to comment.