diff --git a/Python/dawgie/db/shelve/__init__.py b/Python/dawgie/db/shelve/__init__.py index f00eff8..482d221 100644 --- a/Python/dawgie/db/shelve/__init__.py +++ b/Python/dawgie/db/shelve/__init__.py @@ -304,6 +304,10 @@ def reopen()->bool: ''' return DBI().reopen() +def reset (_runid:int, _tn:str, _tskn, _alg)->None: + log.warning('reset() is not implemented for shelve') + return + def retreat (reg, ret)->dawgie.Timeline: '''Get a dawgie.Timeline from the database backend @@ -389,7 +393,7 @@ def versions(): svs_vers = {} tasks_vers = {} vals_vers = {} - for vk,pid in DBI().tables.value: + for vk,pid in DBI().tables.value.items(): pid,vn,vv = util.dissect (vk) pid,svn,svv = util.dissect (DBI().indices.state[pid]) pid,algn,algv = util.dissect (DBI().indices.alg[pid]) @@ -397,18 +401,18 @@ def versions(): tasks_vers[tskn] = True key = '.'.join([tskn, algn]) - if key in algs_vers: algs_vers[key].add (algv.asstring()) - else: algs_vers[key] = {algv.asstring()} + if key in algs_vers: algs_vers[key].append (algv.asstring()) + else: algs_vers[key] = [algv.asstring()] key = '.'.join([tskn, algn, svn]) - if key in svs_vers: svs_vers[key].add (svv.asstring()) - else: svs_vers[key] = {svv.asstring()} + if key in svs_vers: svs_vers[key].append (svv.asstring()) + else: svs_vers[key] = [svv.asstring()] key = '.'.join([tskn, algn, svn, vn]) - if key in vals_vers: vals_vers[key].add (vv.asstring()) - else: vals_vers[key] = {vv.asstring()} + if key in vals_vers: vals_vers[key].append (vv.asstring()) + else: vals_vers[key] = [vv.asstring()] pass return tasks_vers,algs_vers,svs_vers,vals_vers diff --git a/Python/dawgie/pl/scan.py b/Python/dawgie/pl/scan.py index 4e34657..ed11b0b 100644 --- a/Python/dawgie/pl/scan.py +++ b/Python/dawgie/pl/scan.py @@ -48,7 +48,7 @@ def for_factories (ae, pkg): fp = '.'.join ([pkg, pkg_name]) mod = importlib.import_module (fp) dm = dir(mod) - ignore = getattr (mod, 'ignore') if 'ignore' in dm else False + ignore = getattr(mod,'dawgie_ignore') if 'dawgie_ignore' in dm else False if ignore: log.warning ('Ignoring package: %s', fp) diff --git a/Test/test_13.py b/Test/test_13.py index edd9f99..6d96c56 100644 --- a/Test/test_13.py +++ b/Test/test_13.py @@ -104,14 +104,6 @@ def test_archive(self): self.assertTrue (True) # not testable in a reasonable sense return - def test_close(self): - dawgie.db.close() - self.assertFalse (dawgie.db.post._db) - dawgie.db.open() - dawgie.db.close() - self.assertFalse (dawgie.db.post._db) - return - def test_connect(self): tgt,tsk,alg = dawgie.db.testdata.DATASETS[0] dawgie.db.close() @@ -361,7 +353,6 @@ def test_update (self): dawgie.db.close() return - @unittest.skip ('takes too long while developing other tests') def test_versions(self): dawgie.db.close() self.assertRaises (RuntimeError, dawgie.db.versions) @@ -420,6 +411,14 @@ def tearDownClass(cls): shutil.rmtree (cls.root, True) return + def test_close(self): + dawgie.db.close() + self.assertFalse (dawgie.db.post._db) + dawgie.db.open() + dawgie.db.close() + self.assertFalse (dawgie.db.post._db) + return + def test_copy(self): self.assertRaises (NotImplementedError, dawgie.db.copy, 1, 2, 3) return @@ -485,6 +484,14 @@ def tearDownClass(cls): setattr (dawgie.db.shelve.comms.Worker, '_send', cls._send) return + def test_close(self): + dawgie.db.close() + self.assertFalse (dawgie.db.shelve.state.DBI().is_open) + dawgie.db.open() + dawgie.db.close() + self.assertFalse (dawgie.db.shelve.state.DBI().is_open) + return + def test_consistent(self): self.assertRaises(NotImplementedError, dawgie.db.consistent, [],[],'') return