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

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


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

Modified Files:
      Tag: CMF-1_5-branch
	test_CatalogTool.py 
Log Message:
Better compatibility with existing range syntax implementation.


=== Products/CMFCore/tests/test_CatalogTool.py 1.7.14.1 => 1.7.14.2 ===
--- Products/CMFCore/tests/test_CatalogTool.py:1.7.14.1	Tue Nov 16 17:03:03 2004
+++ Products/CMFCore/tests/test_CatalogTool.py	Thu Nov 18 10:54:53 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