Exemplo n.º 1
0
    def setUpClass(cls):
        backend = papis.config.get('database-backend')
        tests.setup_test_library()
        papis.config.set('database-backend', backend)

        libdir = papis.config.get_lib().paths[0]
        assert (os.path.exists(libdir))
        assert (papis.config.get_lib_name() == tests.get_test_lib_name())

        database = papis.database.get(papis.config.get_lib_name())
        database.clear()
        database.initialize()
        assert (database is not None)
Exemplo n.º 2
0
    def setUpClass(cls):
        papis.tests.setup_test_library()

        os.environ['XDG_CACHE_HOME'] = tempfile.mkdtemp(prefix='papisdb-test-')

        libdir = papis.config.get('dir')
        assert (os.path.exists(libdir))
        assert (papis.config.get_lib() == papis.tests.get_test_lib())

        database = papis.database.get(papis.config.get_lib())
        database.clear()
        database.initialize()
        assert (database is not None)
Exemplo n.º 3
0
 def test_clear(self):
     database = papis.database.get()
     database.clear()
     database.initialize()
     self.test_get_all_documents()