Permalink
Browse files

Add tests for persistence

  • Loading branch information...
1 parent 378c416 commit 5ae9f080fce64510d6694fb3f2185cc6c8f92028 @oldpatricka oldpatricka committed Jul 19, 2011
Showing with 7 additions and 1 deletion.
  1. +2 −1 src/python/epumgmt/main/em_core_persistence.py
  2. +5 −0 src/python/tests/mocks/common.py
View
3 src/python/epumgmt/main/em_core_persistence.py
@@ -11,6 +11,7 @@ def __init__(self, params, common):
self.p = params
self.c = common
self.lockfilepath = None
+ self.cdb = None
def _find_db_conf(self):
dbconf = self.p.get_conf_or_none("persistence", "persistencedb")
@@ -87,7 +88,7 @@ def store_run_vms(self, run_name, run_vms):
self.cdb.commit()
def find_instanceid_byservice(self, run_name, servicename):
- """Expects only zero or 1 result -- you cannot use the "piggybacking service" trick with a non-uniqe name
+ """Expects only zero or 1 result -- you cannot use the "piggybacking service" trick with a non-unique name
"""
if not self.cdb:
raise ProgrammingError("cannot persist anything without setup/validation")
View
5 src/python/tests/mocks/common.py
@@ -1,3 +1,4 @@
+import os
import sys
import traceback
@@ -34,3 +35,7 @@ def __init__(self, p=None):
self.log = FakeLog()
self.trace = False
self.p = p
+
+ def resolve_var_dir(self, dir):
+
+ return os.path.join(self.p.get_conf_or_none("ecdirs", "var"), dir)

0 comments on commit 5ae9f08

Please sign in to comment.