Пример #1
0
Файл: config.py Проект: WDR/WDR
 def testOneElementListQuoted(self):
     strIds = (
         ''
         + '['
         + (
             '"'
             + 'user.language'
             + '('
             + 'cells/wdrCell/nodes/wdrNode/servers/wdrServer'
             + '|'
             + 'server.xml'
             + '#'
             + 'Property_1'
             + ')'
             + '"'
         )
         + ']'
     )
     self.assert_(_isConfigIdList(strIds))
     cfgIds = _parseConfigIdList(strIds)
     self.assertEquals(len(cfgIds), 1)
     self.assertEquals(cfgIds[0].name, 'user.language')
     self.assertEquals(
         cfgIds[0].xmlPath, 'cells/wdrCell/nodes/wdrNode/servers/wdrServer'
     )
     self.assertEquals(cfgIds[0].xmlDoc, 'server.xml')
     self.assertEquals(cfgIds[0].xmlId, 'Property_1')
Пример #2
0
 def testThreeElementListQuoted(self):
     strIds = ('' + '[' +
               ('"' + 'user.language' + '(' +
                'cells/wdrCell/nodes/wdrNode/servers/wdrServer' + '|' +
                'server.xml' + '#' + 'Property_1' + ')' + '"') + ' ' +
               ('"' + 'user.region' + '(' +
                'cells/wdrCell/nodes/wdrNode/servers/wdrServer' + '|' +
                'server.xml' + '#' + 'Property_2' + ')' + '"') + ' ' +
               ('"' + 'file.encoding' + '(' +
                'cells/wdrCell/nodes/wdrNode/servers/wdrServer' + '|' +
                'server.xml' + '#' + 'Property_3' + ')' + '"') + ']')
     self.assert_(_isConfigIdList(strIds))
     cfgIds = _parseConfigIdList(strIds)
     self.assertEquals(len(cfgIds), 3)
     self.assertEquals(cfgIds[0].name, 'user.language')
     self.assertEquals(cfgIds[0].xmlPath,
                       'cells/wdrCell/nodes/wdrNode/servers/wdrServer')
     self.assertEquals(cfgIds[0].xmlDoc, 'server.xml')
     self.assertEquals(cfgIds[0].xmlId, 'Property_1')
     self.assertEquals(cfgIds[1].name, 'user.region')
     self.assertEquals(cfgIds[1].xmlPath,
                       'cells/wdrCell/nodes/wdrNode/servers/wdrServer')
     self.assertEquals(cfgIds[1].xmlDoc, 'server.xml')
     self.assertEquals(cfgIds[1].xmlId, 'Property_2')
     self.assertEquals(cfgIds[2].name, 'file.encoding')
     self.assertEquals(cfgIds[2].xmlPath,
                       'cells/wdrCell/nodes/wdrNode/servers/wdrServer')
     self.assertEquals(cfgIds[2].xmlDoc, 'server.xml')
     self.assertEquals(cfgIds[2].xmlId, 'Property_3')
Пример #3
0
Файл: config.py Проект: WDR/WDR
 def testThreeElementList(self):
     strIds = (
         ''
         + '['
         + (
             'user.language'
             + '('
             + 'cells/wdrCell/nodes/wdrNode/servers/wdrServer'
             + '|'
             + 'server.xml'
             + '#'
             + 'Property_1'
             + ')'
         )
         + ' '
         + (
             'user.region'
             + '('
             + 'cells/wdrCell/nodes/wdrNode/servers/wdrServer'
             + '|'
             + 'server.xml'
             + '#'
             + 'Property_2'
             + ')'
         )
         + ' '
         + (
             'file.encoding'
             + '('
             + 'cells/wdrCell/nodes/wdrNode/servers/wdrServer'
             + '|'
             + 'server.xml'
             + '#'
             + 'Property_3'
             + ')'
         )
         + ']'
     )
     self.assert_(_isConfigIdList(strIds))
     cfgIds = _parseConfigIdList(strIds)
     self.assertEquals(len(cfgIds), 3)
     self.assertEquals(cfgIds[0].name, 'user.language')
     self.assertEquals(
         cfgIds[0].xmlPath, 'cells/wdrCell/nodes/wdrNode/servers/wdrServer'
     )
     self.assertEquals(cfgIds[0].xmlDoc, 'server.xml')
     self.assertEquals(cfgIds[0].xmlId, 'Property_1')
     self.assertEquals(cfgIds[1].name, 'user.region')
     self.assertEquals(
         cfgIds[1].xmlPath, 'cells/wdrCell/nodes/wdrNode/servers/wdrServer'
     )
     self.assertEquals(cfgIds[1].xmlDoc, 'server.xml')
     self.assertEquals(cfgIds[1].xmlId, 'Property_2')
     self.assertEquals(cfgIds[2].name, 'file.encoding')
     self.assertEquals(
         cfgIds[2].xmlPath, 'cells/wdrCell/nodes/wdrNode/servers/wdrServer'
     )
     self.assertEquals(cfgIds[2].xmlDoc, 'server.xml')
     self.assertEquals(cfgIds[2].xmlId, 'Property_3')
Пример #4
0
 def testReallyLongList(self):
     strIds = ('[' + ' '.join([
         '(cells/wdrCell|virtualhosts.xml#MimeEntry_%s)' % i
         for i in range(500)
     ]) + ']')
     ids = _parseConfigIdList(strIds)
     self.assertEquals(len(ids), 500)
     for i in range(500):
         self.assertEquals(
             '(cells/wdrCell|virtualhosts.xml#MimeEntry_%s)' % i,
             str(ids[i]))
Пример #5
0
 def testOneElementList(self):
     strIds = ('' + '[' + 'user.language' + '(' +
               'cells/wdrCell/nodes/wdrNode/servers/wdrServer' + '|' +
               'server.xml' + '#' + 'Property_1' + ')' + ']')
     self.assert_(_isConfigIdList(strIds))
     cfgIds = _parseConfigIdList(strIds)
     self.assertEquals(len(cfgIds), 1)
     self.assertEquals(cfgIds[0].name, 'user.language')
     self.assertEquals(cfgIds[0].xmlPath,
                       'cells/wdrCell/nodes/wdrNode/servers/wdrServer')
     self.assertEquals(cfgIds[0].xmlDoc, 'server.xml')
     self.assertEquals(cfgIds[0].xmlId, 'Property_1')
Пример #6
0
Файл: config.py Проект: WDR/WDR
 def testReallyLongList(self):
     strIds = (
         '['
         + ' '.join(
             [
                 '(cells/wdrCell|virtualhosts.xml#MimeEntry_%s)' % i
                 for i in range(500)
             ]
         )
         + ']'
     )
     ids = _parseConfigIdList(strIds)
     self.assertEquals(len(ids), 500)
     for i in range(500):
         self.assertEquals(
             '(cells/wdrCell|virtualhosts.xml#MimeEntry_%s)' % i,
             str(ids[i])
         )
Пример #7
0
Файл: config.py Проект: WDR/WDR
 def testEntireListQuoted(self):
     # WAS 6.1 may return the entire list in quotes
     strIds = (
         ''
         + '"'
         + '['
         + (
             '('
             + 'cells/wdrCell/nodes/wdrNode/servers/wdrServer'
             + '|'
             + 'server.xml'
             + '#'
             + 'SomeObject_1'
             + ')'
         )
         + ' '
         + (
             '('
             + 'cells/wdrCell/nodes/wdrNode/servers/wdrServer'
             + '|'
             + 'server.xml'
             + '#'
             + 'SomeObject_2'
             + ')'
         )
         + ']'
         + '"'
     )
     self.assert_(_isConfigIdList(strIds))
     cfgIds = _parseConfigIdList(strIds)
     self.assertEquals(len(cfgIds), 2)
     self.assertEquals(cfgIds[0].name, '')
     self.assertEquals(
         cfgIds[0].xmlPath, 'cells/wdrCell/nodes/wdrNode/servers/wdrServer'
     )
     self.assertEquals(cfgIds[0].xmlDoc, 'server.xml')
     self.assertEquals(cfgIds[0].xmlId, 'SomeObject_1')
     self.assertEquals(cfgIds[1].name, '')
     self.assertEquals(
         cfgIds[1].xmlPath, 'cells/wdrCell/nodes/wdrNode/servers/wdrServer'
     )
     self.assertEquals(cfgIds[1].xmlDoc, 'server.xml')
     self.assertEquals(cfgIds[1].xmlId, 'SomeObject_2')
Пример #8
0
 def testEntireListQuoted(self):
     # WAS 6.1 may return the entire list in quotes
     strIds = ('' + '"' + '[' +
               ('(' + 'cells/wdrCell/nodes/wdrNode/servers/wdrServer' +
                '|' + 'server.xml' + '#' + 'SomeObject_1' + ')') + ' ' +
               ('(' + 'cells/wdrCell/nodes/wdrNode/servers/wdrServer' +
                '|' + 'server.xml' + '#' + 'SomeObject_2' + ')') + ']' +
               '"')
     self.assert_(_isConfigIdList(strIds))
     cfgIds = _parseConfigIdList(strIds)
     self.assertEquals(len(cfgIds), 2)
     self.assertEquals(cfgIds[0].name, '')
     self.assertEquals(cfgIds[0].xmlPath,
                       'cells/wdrCell/nodes/wdrNode/servers/wdrServer')
     self.assertEquals(cfgIds[0].xmlDoc, 'server.xml')
     self.assertEquals(cfgIds[0].xmlId, 'SomeObject_1')
     self.assertEquals(cfgIds[1].name, '')
     self.assertEquals(cfgIds[1].xmlPath,
                       'cells/wdrCell/nodes/wdrNode/servers/wdrServer')
     self.assertEquals(cfgIds[1].xmlDoc, 'server.xml')
     self.assertEquals(cfgIds[1].xmlId, 'SomeObject_2')
Пример #9
0
 def testMaskedList(self):
     strIds = '*****'
     self.assert_(_isConfigIdList(strIds))
     cfgIds = _parseConfigIdList(strIds)
     self.assertEquals(len(cfgIds), 0)
Пример #10
0
 def testEmptyElementList(self):
     strIds = '[]'
     self.assert_(_isConfigIdList(strIds))
     cfgIds = _parseConfigIdList(strIds)
     self.assertEquals(len(cfgIds), 0)
Пример #11
0
Файл: config.py Проект: WDR/WDR
 def testMaskedList(self):
     strIds = '*****'
     self.assert_(_isConfigIdList(strIds))
     cfgIds = _parseConfigIdList(strIds)
     self.assertEquals(len(cfgIds), 0)
Пример #12
0
Файл: config.py Проект: WDR/WDR
 def testEmptyElementList(self):
     strIds = '[]'
     self.assert_(_isConfigIdList(strIds))
     cfgIds = _parseConfigIdList(strIds)
     self.assertEquals(len(cfgIds), 0)