Coverage for modules/org/openteacher/logic/loaders/test/test : 92%
Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
|
#! /usr/bin/env python3 # -*- coding: utf-8 -*-
# Copyright 2012-2014, Marten de Vries # # This file is part of OpenTeacher. # # OpenTeacher is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # OpenTeacher is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with OpenTeacher. If not, see <http://www.gnu.org/licenses/>.
#files that aren't loadable that have mods to load them with #some files' load mods can't be found by the default algorithm #below. They're in the 'endsWith-dict' below. #Special case for abbyy since it doesn't have a mimetype (".xml", set(self._mm.mods("active", type="load", loads={"xml": ["words"]}))), #same for csv (".csv", set(self._mm.mods("active", type="load", loads={"csv": ["words"]}))), #same for sqlite .db (".db", set(self._mm.mods("active", type="load", loads={"db": ["words"]}))), #gnuVocabTrain .txt ("gnuVocabTrain.txt", set(self._mm.mods("active", type="load", format="gnuVocabTrain"))), #vTrain .txt ("vtrain.txt", set(self._mm.mods("active", type="load", format="vtrain"))), ] #the normal algorithm - dissecting the mimetype from the #filename and loading the load module based on that mimetype.
self.skipTest("Not running in one of these modes: " + ", ".join(MODES)) #don't run the tests. return [] #only load when not yet in cache.
#feel free to extend with new lesson types except AssertionError: print(file, mod) raise
#optional. But not empty
except AssertionError: print(data["mod"], data["file"]) raise
set(self._mm.mods(type="load")), set(self._mm.mods("active", type="load")) )
self._mm.mods(type="load"), )
|