Example #1
0
 def test_no_pubdate(self):
     q, o = _filter_by_pubdate('foo', {})
     self.assertEqual(q, 'foo')
     self.assertTrue('rf' not in o)
Example #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')
Example #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))
Example #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)
Example #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')
Example #6
0
 def test_no_pubdate(self):
     q, o = _filter_by_pubdate('foo', {})
     self.assertEqual(q, 'foo')
     self.assertTrue('rf' not in o)
Example #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))
Example #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')
Example #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')
Example #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)