Ejemplo n.º 1
0
 def test_no_pubdate(self):
     q, o = _filter_by_pubdate('foo', {})
     self.assertEqual(q, 'foo')
     self.assertTrue('rf' not in o)
Ejemplo n.º 2
0
 def test_pubdate_no_start(self):
     q, o = _filter_by_pubdate('foo AND PublicationDate:[-1986]', {})
     self.assertEqual(q, 'foo')
     self.assertEqual(o['rf'], 'PublicationDate,1000:1986')
Ejemplo n.º 3
0
 def test_pubdate_no_end(self):
     year = datetime.datetime.now().year
     q, o = _filter_by_pubdate('foo AND PublicationDate:[1980-]', {})
     self.assertEqual(q, 'foo')
     self.assertEqual(o['rf'], 'PublicationDate,1980:' + str(year))
Ejemplo n.º 4
0
 def test_single_pubdate(self):
     q, o = _filter_by_pubdate('foo AND PublicationDate:1984', {})
     self.assertEqual(q, 'foo AND PublicationDate:1984')
     self.assertTrue('rf' not in o)
Ejemplo n.º 5
0
 def test_pubdate_range(self):
     q, o = _filter_by_pubdate('foo AND PublicationDate:[1984-1986]', {})
     self.assertEqual(q, 'foo')
     self.assertEqual(o['rf'], 'PublicationDate,1984:1986')
Ejemplo n.º 6
0
 def test_no_pubdate(self):
     q, o = _filter_by_pubdate('foo', {})
     self.assertEqual(q, 'foo')
     self.assertTrue('rf' not in o)
Ejemplo n.º 7
0
 def test_pubdate_no_end(self):
     year = datetime.datetime.now().year
     q, o = _filter_by_pubdate('foo AND PublicationDate:[1980-]', {})
     self.assertEqual(q, 'foo')
     self.assertEqual(o['rf'], 'PublicationDate,1980:' + str(year))
Ejemplo n.º 8
0
 def test_pubdate_no_start(self):
     q, o = _filter_by_pubdate('foo AND PublicationDate:[-1986]', {})
     self.assertEqual(q, 'foo')
     self.assertEqual(o['rf'], 'PublicationDate,1000:1986')
Ejemplo n.º 9
0
 def test_pubdate_range(self):
     q, o = _filter_by_pubdate('foo AND PublicationDate:[1984-1986]', {})
     self.assertEqual(q, 'foo')
     self.assertEqual(o['rf'], 'PublicationDate,1984:1986')
Ejemplo n.º 10
0
 def test_single_pubdate(self):
     q, o = _filter_by_pubdate('foo AND PublicationDate:1984', {})
     self.assertEqual(q, 'foo AND PublicationDate:1984')
     self.assertTrue('rf' not in o)