Exemplo n.º 1
0
 def test_make_fq(self):
     test_pairs = (('1 2', '1 AND 2'), ('1 and 2', '1 AND 2'),
                   ('"1 AND 2"', '"1 AND 2"'), ('"1 2"', '"1 2"'),
                   ('1 OR 2', '1 OR 2'), ('1 NOT 2', '1 NOT 2'),
                   ('cause:sympathy', 'cause AND sympathy'))
     for test in test_pairs:
         field = 'f'
         key = 'key'
         self.assertEqual(make_fq(cd={key: test[0]}, field=field, key=key),
                          '%s:(%s)' % (field, test[1]))
Exemplo n.º 2
0
 def test_make_fq(self):
     test_pairs = (
         ('1 2', '1 AND 2'),
         ('1 and 2', '1 AND 2'),
         ('"1 AND 2"', '"1 AND 2"'),
         ('"1 2"', '"1 2"'),
         ('1 OR 2', '1 OR 2'),
         ('1 NOT 2', '1 NOT 2'),
     )
     for test in test_pairs:
         field = 'f'
         key = 'key'
         self.assertEqual(
             make_fq(cd={key: test[0]}, field=field, key=key),
             '%s:(%s)' % (field, test[1])
         )
Exemplo n.º 3
0
 def test_make_fq(self):
     test_pairs = (
         ("1 2", "1 AND 2"),
         ("1 and 2", "1 AND 2"),
         ('"1 AND 2"', '"1 AND 2"'),
         ('"1 2"', '"1 2"'),
         ("1 OR 2", "1 OR 2"),
         ("1 NOT 2", "1 NOT 2"),
         ("cause:sympathy", "cause AND sympathy"),
     )
     for test in test_pairs:
         field = "f"
         key = "key"
         self.assertEqual(
             make_fq(cd={key: test[0]}, field=field, key=key),
             "%s:(%s)" % (field, test[1]),
         )
Exemplo n.º 4
0
 def test_make_fq(self) -> None:
     test_pairs = (
         ("1 2", "1 AND 2"),
         ("1 and 2", "1 AND 2"),
         ('"1 AND 2"', '"1 AND 2"'),
         ('"1 2"', '"1 2"'),
         ("1 OR 2", "1 OR 2"),
         ("1 NOT 2", "1 NOT 2"),
         ("cause:sympathy", "cause AND sympathy"),
     )
     for test in test_pairs:
         field = "f"
         key = "key"
         self.assertEqual(
             make_fq(cd={key: test[0]}, field=field, key=key),
             f"{field}:({test[1]})",
         )