http://code.google.com/p/pycopia/source/detail?r=526
Modified:
/trunk/QA/pycopia/QA/config.py
/trunk/process/pycopia/expect.py
/trunk/storage/pycopia/db/importers/testcases.py
=======================================
--- /trunk/QA/pycopia/QA/config.py Tue Nov 22 16:33:58 2011
+++ /trunk/QA/pycopia/QA/config.py Thu Jan 19 21:31:25 2012
@@ -332,6 +332,15 @@
raise config.ConfigError("Bad account identifier %r: %s" %
(name, err))
return acct.login, acct.password
+ def get_equipment(self, name):
+ """Get any equipment runtime from the configuration by name."""
+ db = self.session
+ try:
+ eqrow =
db.query(models.Equipment).filter(models.Equipment.name.contains(name)).one()
+ except config.NoResultFound as err:
+ raise config.ConfigError("Bad equipment name %r: %s" % (name,
err))
+ return EquipmentRuntime(eqrow, "unspecified", self.get_logfile(),
db)
+
# user-specific configuration variables.
# user configuration is explicit, contained in this "userconfig"
attribute,
# which maps to a configuration container that has the same name as the
=======================================
--- /trunk/process/pycopia/expect.py Wed Oct 20 16:37:43 2010
+++ /trunk/process/pycopia/expect.py Thu Jan 19 21:31:25 2012
@@ -401,11 +401,11 @@
while 1:
c = self.read(1, timeout)
if c == "":
- return
+ raise ExpectError("EOF during
read_until({!r}).".format(patt))
buf += c
i = buf.find(patt)
if i >= 0:
- return buf[:-len(patt)]
+ return buf[:i]
def readline(self, timeout=None):
return self.read_until("\n", timeout)
=======================================
--- /trunk/storage/pycopia/db/importers/testcases.py Wed Oct 12 17:26:18
2011
+++ /trunk/storage/pycopia/db/importers/testcases.py Thu Jan 19 21:31:25
2012
@@ -361,6 +361,7 @@
else:
if _FORCE:
_dbsession.delete(dbcase)
+ _dbsession.commit()
dbcase = create_TestCase(testinstance)
else:
update_TestCase(testinstance, dbcase)
@@ -380,6 +381,7 @@
else:
if _FORCE:
_dbsession.delete(dbcase)
+ _dbsession.commit()
dbcase = create_TestCase(entry.inst)
else:
update_TestCase(entry.inst, dbcase)
@@ -412,6 +414,7 @@
else:
if _FORCE:
_dbsession.delete(testsuite)
+ _dbsession.commit()
testsuite = models.create(models.TestSuite, **kwargs)
_dbsession.add(testsuite)
_dbsession.commit()