From 88346f8ed3509ca3c25fee8891fe5db7d6d8f5d0 Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Sat, 12 Apr 2014 18:23:48 -0400 Subject: [PATCH] Unit Tests - Cleaned up unit tests. --- test/tw-1300.t | 20 ++------------------ 1 file changed, 2 insertions(+), 18 deletions(-) diff --git a/test/tw-1300.t b/test/tw-1300.t index 7a0e0f1d0..2fa288243 100755 --- a/test/tw-1300.t +++ b/test/tw-1300.t @@ -59,28 +59,12 @@ class TestBug1300(BaseTestBug1300): def test_dom_exit_status_good(self): """If the DOM recognizes a reference, it should return '0' """ - args = ["rc:bug.rc", "_get", "context.program"] - - self.run_command(args, 0) + self.callTaskSuccess(["rc:bug.rc", "_get", "context.program"]) def test_dom_exit_status_bad(self): """If the DOM does not recognize a reference, it should return '1' """ - args = ["rc:bug.rc", "_get", "XYZ"] - - self.run_command(args, 1) - - def run_command(self, args, expected_status): - code, out, err = self.callTask(args) - - # We shouldn't get a segmentation fault - # (negative exit code == 128 - real_exit_code) - expected = -signal.SIGSEGV - self.assertNotEqual(expected, code, "Task segfaulted") - - # Instead we expect a clean exit - self.assertEqual(expected_status, code, - "Exit code was not ({0}), but ({0})".format(expected_status, code)) + self.callTaskError(["rc:bug.rc", "_get", "XYZ"]) if __name__ == "__main__":