From 5f6b0b71a0dccf6a12eb2f7b1e18a60122fbca15 Mon Sep 17 00:00:00 2001 From: Michael Hanselmann <hansmi@google.com> Date: Wed, 15 Sep 2010 19:31:44 +0200 Subject: [PATCH] Add small jqueue unittests Signed-off-by: Michael Hanselmann <hansmi@google.com> Reviewed-by: Iustin Pop <iustin@google.com> --- test/ganeti.jqueue_unittest.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/test/ganeti.jqueue_unittest.py b/test/ganeti.jqueue_unittest.py index ab6ce2225..2a7b61c3b 100755 --- a/test/ganeti.jqueue_unittest.py +++ b/test/ganeti.jqueue_unittest.py @@ -275,6 +275,10 @@ class TestQueuedOpCode(unittest.TestCase): class TestQueuedJob(unittest.TestCase): + def test(self): + self.assertRaises(errors.GenericError, jqueue._QueuedJob, + None, 1, []) + def testDefaults(self): job_id = 4260 ops = [ @@ -294,6 +298,10 @@ class TestQueuedJob(unittest.TestCase): self.assertEqual(len(job.ops), len(ops)) self.assert_(compat.all(inp.__getstate__() == op.input.__getstate__() for (inp, op) in zip(ops, job.ops))) + self.assertRaises(errors.OpExecError, job.GetInfo, + ["unknown-field"]) + self.assertEqual(job.GetInfo(["summary"]), + [[op.input.Summary() for op in job.ops]]) job1 = jqueue._QueuedJob(None, job_id, ops) _Check(job1) -- GitLab