From 7b62c5eb3191e73ae5ed290b7ac541844ec245ef Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Tue, 7 May 2019 06:53:16 +0100 Subject: [PATCH] update layout of test_helper.py --- src/TestUtil/test_helper.py | 37 ++++++++++++++++++++----------------- 1 file changed, 20 insertions(+), 17 deletions(-) diff --git a/src/TestUtil/test_helper.py b/src/TestUtil/test_helper.py index d22124b8..c42990d6 100644 --- a/src/TestUtil/test_helper.py +++ b/src/TestUtil/test_helper.py @@ -1,27 +1,30 @@ -# Verifies the given values given the particular operand -# Arguments: -# p (Prefix): Appended to the front of the assert statement -# e (Expected): The expected value -# o (Output): The output result -# op (Operation): (0 => ==), (1 => !=) def assert_op(pre, o, e, op): + """ Verifies the given values given the particular operand + Arguments: + p (Prefix): Appended to the front of the assert statement + e (Expected): The expected value + o (Output): The output result + op (Operation): (0 => ==), (1 => !=) + """ if op == 0: assert_eq(pre, o, e) else: assert_ne(pre, o, e) -# Verifies the given values are equal -# Arguments: -# p (Prefix): Appended to the front of the assert statement -# e (Expected): The expected value -# o (Output): The output result def assert_eq(p, o, e): + """ Verifies the given values are equal + Arguments: + p (Prefix): Appended to the front of the assert statement + e (Expected): The expected value + o (Output): The output result + """ assert o == e, p + " Output " + str(o) + " Expected " + str(e) -# Verifies the given values are not equal -# Arguments: -# p (Prefix): Appended to the front of the assert statement -# e (Expected): The expected value -# o (Output): The output result def assert_ne(p, o, e): - assert o != e, p + " Output " + str(o) + " Not Expecting " + str(e) \ No newline at end of file + """ Verifies the given values are not equal + Arguments: + p (Prefix): Appended to the front of the assert statement + e (Expected): The expected value + o (Output): The output result + """ + assert o != e, p + " Output " + str(o) + " Not Expecting " + str(e) -- 2.30.2