[CMF-checkins] CVS: Products/CMFCore/tests - test_CatalogTool.py:1.9

Florent Guillaume fg at nuxeo.com
Thu Nov 18 10:54:17 EST 2004


Update of /cvs-repository/Products/CMFCore/tests
In directory cvs.zope.org:/tmp/cvs-serv23541/tests

Modified Files:
	test_CatalogTool.py 
Log Message:
Better compatibility with existing range syntax implementation.


=== Products/CMFCore/tests/test_CatalogTool.py 1.8 => 1.9 ===
--- Products/CMFCore/tests/test_CatalogTool.py:1.8	Tue Nov 16 17:06:50 2004
+++ Products/CMFCore/tests/test_CatalogTool.py	Thu Nov 18 10:54:16 2004
@@ -109,6 +109,12 @@
             expires={'query': now-1, 'range': 'max'})))
         self.assertEqual(1, len(catalog.searchResults(
             expires={'query': (now-3, now-1), 'range': 'min:max'})))
+        self.assertEqual(1, len(catalog.searchResults(
+            expires={'query': (now-3, now-1), 'range': 'minmax'})))
+        self.assertEqual(1, len(catalog.searchResults(
+            expires={'query': now-2})))
+        self.assertEqual(1, len(catalog.searchResults(
+            expires={'query': now-2, 'range': None})))
 
     def test_search_restrict_inactive(self):
         catalog = CatalogTool()
@@ -135,6 +141,10 @@
             expires={'query': now+3, 'range': 'max'})))
         self.assertEqual(0, len(catalog.searchResults(
             expires={'query': (now-3, now-1), 'range': 'min:max'})))
+        self.assertEqual(0, len(catalog.searchResults(
+            expires={'query': (now-3, now-1), 'range': 'minmax'})))
+        self.assertEqual(0, len(catalog.searchResults(
+            expires={'query': now-2, 'range': None})))
 
     def test_search_restrict_visible(self):
         catalog = CatalogTool()
@@ -161,6 +171,10 @@
             effective={'query': now+1, 'range': 'max'})))
         self.assertEqual(0, len(catalog.searchResults(
             effective={'query': (now-1, now+1), 'range': 'min:max'})))
+        self.assertEqual(0, len(catalog.searchResults(
+            effective={'query': (now-1, now+1), 'range': 'minmax'})))
+        self.assertEqual(1, len(catalog.searchResults(
+            expires={'query': now-2, 'range': None})))
 
         self.assertEqual(1, len(catalog.searchResults(
             effective={'query': now-3, 'range': 'min'})))
@@ -172,6 +186,8 @@
             effective={'query': now+3, 'range': 'max'})))
         self.assertEqual(1, len(catalog.searchResults(
             effective={'query': (now-3, now+3), 'range': 'min:max'})))
+        self.assertEqual(1, len(catalog.searchResults(
+            effective={'query': (now-3, now+3), 'range': 'minmax'})))
 
         self.assertEqual(1, len(catalog.searchResults(
             expires={'query': now-1, 'range': 'min'})))
@@ -183,6 +199,8 @@
             expires={'query': now+1, 'range': 'max'})))
         self.assertEqual(0, len(catalog.searchResults(
             expires={'query': (now-1, now+1), 'range': 'min:max'})))
+        self.assertEqual(0, len(catalog.searchResults(
+            expires={'query': (now-1, now+1), 'range': 'minmax'})))
 
         self.assertEqual(1, len(catalog.searchResults(
             expires={'query': now-3, 'range': 'min'})))
@@ -194,6 +212,8 @@
             expires={'query': now+3, 'range': 'max'})))
         self.assertEqual(1, len(catalog.searchResults(
             expires={'query': (now-3, now+3), 'range': 'min:max'})))
+        self.assertEqual(1, len(catalog.searchResults(
+            expires={'query': (now-3, now+3), 'range': 'minmax'})))
 
         self.assertEqual(1, len(catalog.searchResults(
             effective={'query': now-1, 'range': 'max'},



More information about the CMF-checkins mailing list