예제 #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))
예제 #2
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))
예제 #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()