diff --git a/runtests.sh b/runtests.sh new file mode 100755 index 0000000..efce850 --- /dev/null +++ b/runtests.sh @@ -0,0 +1,3 @@ + +python tests/test_postgres.py +python tests/test_standard.py diff --git a/scopes/storage/tracking.py b/scopes/storage/tracking.py index e0b747f..d16acc6 100644 --- a/scopes/storage/tracking.py +++ b/scopes/storage/tracking.py @@ -54,11 +54,6 @@ class Track(object): else: self.data.update(data) - def storeTrack(self): - """Make changes of this track persistent by updating the corresponding row - in its container.""" - self.container.update(self) - @property def uid(self): if self.trackId is None: @@ -76,7 +71,17 @@ class Track(object): def asDict(self): return dict(uid=self.uid, head=self.head, data=self.data, - timeStamp = str(self.timeStamp)[:19]) + timeStamp=str(self.timeStamp)[:19]) + + # shortcuts for compatibility with existing software: + + def updateIndex(self, **kw): + for k, v in kw.items(): + self.set(k, v) + self.storeTrack() + + def storeTrack(self): + self.container.update(self) @registerContainerClass diff --git a/tests/test_postgres.py b/tests/test_postgres.py index bc07c0f..c4a61e8 100644 --- a/tests/test_postgres.py +++ b/tests/test_postgres.py @@ -23,6 +23,12 @@ class Test(unittest.TestCase): def test_002_folder(self): tlib_storage.test_folder(self, config) + def test_003_type(self): + tlib_storage.test_type(self, config) + + def test_004_topic(self): + tlib_storage.test_topic(self, config) + def suite(): return unittest.TestSuite(( unittest.TestLoader().loadTestsFromTestCase(Test),