Example #1
0
 def test_returns_complex_query_values_unchanged(self):
     qp = KeywordIndexQueryParser()
     self.assertEqual({"query": "keyword"}, qp.parse({"query": "keyword"}))
     self.assertEqual({"query": 42}, qp.parse({"query": 42}))
Example #2
0
 def test_casts_range_option_to_string(self):
     qp = KeywordIndexQueryParser()
     self.assertEqual(
         {"range": "42", "query": "keyword"},
         qp.parse({"range": 42, "query": "keyword"}),
     )
Example #3
0
 def test_returns_simple_query_unchanged(self):
     qp = KeywordIndexQueryParser()
     self.assertEqual("keyword", qp.parse("keyword"))
     self.assertEqual(42, qp.parse(42))
 def test_casts_range_option_to_string(self):
     qp = KeywordIndexQueryParser()
     self.assertEqual(
         {'range': '42', 'query': 'keyword'},
         qp.parse({'range': 42, 'query': 'keyword'}))
 def test_returns_complex_query_values_unchanged(self):
     qp = KeywordIndexQueryParser()
     self.assertEqual({'query': 'keyword'}, qp.parse({'query': 'keyword'}))
     self.assertEqual({'query': 42}, qp.parse({'query': 42}))
 def test_returns_simple_query_unchanged(self):
     qp = KeywordIndexQueryParser()
     self.assertEqual('keyword', qp.parse('keyword'))
     self.assertEqual(42, qp.parse(42))
Example #7
0
 def test_casts_range_option_to_string(self):
     qp = KeywordIndexQueryParser()
     self.assertEqual(
         {'range': '42', 'query': 'keyword'},
         qp.parse({'range': 42, 'query': 'keyword'}))