[CalendarServer-changes] [8776] CalendarServer/branches/users/glyph/case-insensitive-uid

source_changes at macosforge.org source_changes at macosforge.org
Wed Feb 29 10:15:02 PST 2012


Revision: 8776
          http://trac.macosforge.org/projects/calendarserver/changeset/8776
Author:   glyph at apple.com
Date:     2012-02-29 10:15:02 -0800 (Wed, 29 Feb 2012)
Log Message:
-----------
tests for translating check constraints

Modified Paths:
--------------
    CalendarServer/branches/users/glyph/case-insensitive-uid/txdav/common/datastore/test/test_sql_tables.py

Property Changed:
----------------
    CalendarServer/branches/users/glyph/case-insensitive-uid/

Modified: CalendarServer/branches/users/glyph/case-insensitive-uid/txdav/common/datastore/test/test_sql_tables.py
===================================================================
--- CalendarServer/branches/users/glyph/case-insensitive-uid/txdav/common/datastore/test/test_sql_tables.py	2012-02-29 18:14:58 UTC (rev 8775)
+++ CalendarServer/branches/users/glyph/case-insensitive-uid/txdav/common/datastore/test/test_sql_tables.py	2012-02-29 18:15:02 UTC (rev 8776)
@@ -212,7 +212,40 @@
         )
 
 
+    def test_anonymousCheckConstraint(self):
+        """
+        Named 'check' constraints are propagated through translation without
+        modification.
+        """
+        self.assertSortaEquals(
+            self.translated(SchemaSyntax(self.schemaFromString(
+                            "create table alpha ( "
+                            'beta integer, check(beta > 3)'
+                            " );"
+                        ))),
+            "create table alpha ("
+            '"beta" integer, check("beta" > 3)'
+            ");"
+        )
 
+
+    def test_namedCheckConstraint(self):
+        """
+        Named 'check' constraints are propagated through translation without
+        modification.
+        """
+        self.assertSortaEquals(
+            self.translated(SchemaSyntax(self.schemaFromString(
+                            "create table alpha ( "
+                            'beta integer, constraint beta_lt_3 check(beta > 3)'
+                            " );"
+                        ))),
+            "create table alpha ("
+            '"beta" integer, constraint beta_lt_3 check("beta" > 3)'
+            ");"
+        )
+
+
     def test_youBrokeTheSchema(self):
         """
         Oracle table names have a 30-character limit.  Our schema translator
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20120229/74a47f16/attachment-0001.html>


More information about the calendarserver-changes mailing list