示例#1
0
    def testInitialization(self):
        """Test initialisation."""
        originalEngine = self.db.engine

        # test if dictionary is accepted
        self.db.engine = EngineMock(originalEngine, mockTables=[self.table])

        self.assert_(self.dictionaryClass.available(self.db))
        dictionary = getDictionary(self.DICTIONARY, dbConnectInst=self.db)
        self.assert_(self.dictionaryClass in getAvailableDictionaries(self.db))

        # test if character domain is rejected
        self.db.engine = EngineMock(originalEngine, mockNonTables=[self.table])

        self.assert_(not self.dictionaryClass.available(self.db))
        self.assertRaises(ValueError, getDictionary, self.DICTIONARY,
            dbConnectInst=self.db)
        self.assert_(self.dictionaryClass not in getAvailableDictionaries(
            self.db))
    def testInitialization(self):
        """Test initialisation."""
        originalEngine = self.db.engine

        # test if dictionary is accepted
        self.db.engine = EngineMock(originalEngine, mockTables=[self.table])

        self.assert_(self.dictionaryClass.available(self.db))
        dictionary = getDictionary(self.DICTIONARY, dbConnectInst=self.db)
        self.assert_(self.dictionaryClass in getAvailableDictionaries(self.db))

        # test if character domain is rejected
        self.db.engine = EngineMock(originalEngine, mockNonTables=[self.table])

        self.assert_(not self.dictionaryClass.available(self.db))
        self.assertRaises(ValueError,
                          getDictionary,
                          self.DICTIONARY,
                          dbConnectInst=self.db)
        self.assert_(
            self.dictionaryClass not in getAvailableDictionaries(self.db))
示例#3
0
def iterDictionary(dictionary):
    d = getDictionary(dictionary, columnFormatStrategies={'Reading': None})
    return d.getAll()
示例#4
0
def iterDictionary(dictionary):
    d = getDictionary(dictionary, columnFormatStrategies={'Reading': None})
    return d.getAll()