コード例 #1
0
 def testSomeContent(self):
     some_content = {
         "lang": "bad",
         "somevar": True,
         "Othervar": 1,
         "langage": "en",
         "profile": "story",
         "has": "audio",
     }
     with self.assertRaises(BadQuery):
         make_query(self.test_template, some_content)
コード例 #2
0
 def testGoodContent(self):
     good_content = {"language": "en", "profile": "story", "has": "audio"}
     result = make_query(self.test_template, good_content)
     self.assertIn("language=en", result)
     self.assertIn("profile=story", result)
     self.assertIn("has=audio", result)
     self.assertIn("?", result)
コード例 #3
0
 def testBadContent(self):
     bad_content = {"lang": "bad", "somevar": True, "Othervar": 1}
     with self.assertRaises(BadQuery):
         make_query(self.test_template, bad_content)
コード例 #4
0
 def testNoContent(self):
     no_content = {}
     expected = self.test_template.split("{?")[0]
     self.assertEqual(make_query(self.test_template, no_content), expected)