server/test/unittest_schemaserial.py
changeset 2476 1294a6bdf3bf
parent 2447 b83fcc2311af
child 2730 bb6fcb8c5d71
equal deleted inserted replaced
2475:b6753521129d 2476:1294a6bdf3bf
    22 
    22 
    23     def test_eschema2rql1(self):
    23     def test_eschema2rql1(self):
    24         self.assertListEquals(list(eschema2rql(schema.eschema('CWAttribute'))),
    24         self.assertListEquals(list(eschema2rql(schema.eschema('CWAttribute'))),
    25                               [
    25                               [
    26             ('INSERT CWEType X: X description %(description)s,X final %(final)s,X name %(name)s',
    26             ('INSERT CWEType X: X description %(description)s,X final %(final)s,X name %(name)s',
    27              {'description': u'define a final relation: link a final relation type from a non final entity to a final entity type. used to build the application schema',
    27              {'description': u'define a final relation: link a final relation type from a non final entity to a final entity type. used to build the instance schema',
    28               'name': u'CWAttribute', 'final': False})
    28               'name': u'CWAttribute', 'final': False})
    29             ])
    29             ])
    30 
    30 
    31     def test_eschema2rql2(self):
    31     def test_eschema2rql2(self):
    32         self.assertListEquals(list(eschema2rql(schema.eschema('String'))), [
    32         self.assertListEquals(list(eschema2rql(schema.eschema('String'))), [
    99 
    99 
   100 
   100 
   101     def test_updateeschema2rql1(self):
   101     def test_updateeschema2rql1(self):
   102         self.assertListEquals(list(updateeschema2rql(schema.eschema('CWAttribute'))),
   102         self.assertListEquals(list(updateeschema2rql(schema.eschema('CWAttribute'))),
   103                               [('SET X description %(description)s,X final %(final)s,X name %(name)s WHERE X is CWEType, X name %(et)s',
   103                               [('SET X description %(description)s,X final %(final)s,X name %(name)s WHERE X is CWEType, X name %(et)s',
   104                                 {'description': u'define a final relation: link a final relation type from a non final entity to a final entity type. used to build the application schema', 'et': 'CWAttribute', 'final': False, 'name': u'CWAttribute'}),
   104                                 {'description': u'define a final relation: link a final relation type from a non final entity to a final entity type. used to build the instance schema', 'et': 'CWAttribute', 'final': False, 'name': u'CWAttribute'}),
   105                                ])
   105                                ])
   106 
   106 
   107     def test_updateeschema2rql2(self):
   107     def test_updateeschema2rql2(self):
   108         self.assertListEquals(list(updateeschema2rql(schema.eschema('String'))),
   108         self.assertListEquals(list(updateeschema2rql(schema.eschema('String'))),
   109                               [('SET X description %(description)s,X final %(final)s,X name %(name)s WHERE X is CWEType, X name %(et)s',
   109                               [('SET X description %(description)s,X final %(final)s,X name %(name)s WHERE X is CWEType, X name %(et)s',