예제 #1
0
파일: test_steam.py 프로젝트: dgnorth/drift
 def test_broken_url(self):
     # Verify that broken key url is caught
     with self.assertRaises(ServiceUnavailable) as context:
         run_ticket_validation({'ticket': self.ticket, 'appid': 123}, key_url='http://localhost:1/')
     self.assertIn("The server is temporarily unable", context.exception.description)
예제 #2
0
파일: test_steam.py 프로젝트: dgnorth/drift
 def test_steam(self):
     # Can't really test this. Just mock success cases from api.steampowered.com.
     steamid = run_ticket_validation({'steamid': self.steamid, 'ticket': self.ticket, 'appid': 123}, key_url='key url')
     self.assertTrue(steamid == self.steamid)
예제 #3
0
파일: test_steam.py 프로젝트: dgnorth/drift
 def test_missing_fields(self):
     # Verify missing field check. The exception will list out all missing fields, so by removing
     # a single field, we should only be notified of that one missing.
     with self.assertRaises(Unauthorized) as context:
         run_ticket_validation({})
     self.assertIn("The token is missing required fields: ticket, appid.", context.exception.description)