diff options
author | Jose <jose@zeroc.com> | 2018-08-06 11:56:42 +0200 |
---|---|---|
committer | Jose <jose@zeroc.com> | 2018-08-06 11:56:42 +0200 |
commit | 7972f07a3aa244dcde673b7cb5541e70da9193bb (patch) | |
tree | 117faced1bb36ac256c7d362e11ac1c49e8e8c88 /python/test/Slice/import/Client.py | |
parent | Update JavaScript tests to use TestHelper class (diff) | |
download | ice-7972f07a3aa244dcde673b7cb5541e70da9193bb.tar.bz2 ice-7972f07a3aa244dcde673b7cb5541e70da9193bb.tar.xz ice-7972f07a3aa244dcde673b7cb5541e70da9193bb.zip |
Python test suite updates
Diffstat (limited to 'python/test/Slice/import/Client.py')
-rwxr-xr-x | python/test/Slice/import/Client.py | 36 |
1 files changed, 13 insertions, 23 deletions
diff --git a/python/test/Slice/import/Client.py b/python/test/Slice/import/Client.py index 93811469483..c5f65ba3d86 100755 --- a/python/test/Slice/import/Client.py +++ b/python/test/Slice/import/Client.py @@ -8,36 +8,26 @@ # # ********************************************************************** -import os, sys, traceback - -for toplevel in [".", "..", "../..", "../../..", "../../../.."]: - toplevel = os.path.normpath(toplevel) - if os.path.exists(os.path.join(toplevel, "python", "Ice", "__init__.py")): - break -else: - raise RuntimeError("can't find toplevel directory!") - +from TestHelper import TestHelper +import sys import Test -status = True def test(b): if not b: raise RuntimeError('test assertion failed') -try: - sys.stdout.write("testing imports... ") - sys.stdout.flush() - test(Test.SubA.SubSubA1.Value1 == 10) - test(Test.SubA.SubSubA1.Value2 == 11) - test(Test.SubA.SubSubA2.Value1 == 30) - test(Test.SubB.SubSubB1.Value1 == 20) - test(Test.SubB.SubSubB1.Value2 == 21) +class Client(TestHelper): + + def run(self, args): + sys.stdout.write("testing imports... ") + sys.stdout.flush() - print("ok") -except: - traceback.print_exc() - status = False + test(Test.SubA.SubSubA1.Value1 == 10) + test(Test.SubA.SubSubA1.Value2 == 11) + test(Test.SubA.SubSubA2.Value1 == 30) + test(Test.SubB.SubSubB1.Value1 == 20) + test(Test.SubB.SubSubB1.Value2 == 21) -sys.exit(not status) + print("ok") |