X-Git-Url: https://git.phdru.name/?a=blobdiff_plain;f=m_lib%2Fflad%2Ftest%2Ftest1.py;h=16c7bb319fbf6d29769c4bcd7c3dc1ec1f467199;hb=fb3af94919a9ee18ba1c35f927f19837f057fa1f;hp=5ac6217c6c48c31a01270967c911365aa366ec15;hpb=9a523766e02fc3c5d1df4550385a604dca8e6e80;p=m_lib.git diff --git a/m_lib/flad/test/test1.py b/m_lib/flad/test/test1.py index 5ac6217..16c7bb3 100755 --- a/m_lib/flad/test/test1.py +++ b/m_lib/flad/test/test1.py @@ -1,53 +1,54 @@ #! /usr/bin/env python +from __future__ import print_function from m_lib.flad import fladm def test(): print - print "Test 1:", + print("Test 1:", end=' ') fladm.load_from_file("test.txt", fladm.check_record, None, None) - print "Ok" + print("Ok") - print "Test 2:", + print("Test 2:", end=' ') fladm.load_from_file("test.txt", fladm.check_record, ["Type"], None) - print "Ok" + print("Ok") - print "Test 3:", + print("Test 3:", end=' ') fladm.load_from_file("test.txt", fladm.check_record, ["Type", "Name"], None) - print "Ok" + print("Ok") - print "Test 4:", + print("Test 4:", end=' ') fladm.load_from_file("test.txt", fladm.check_record, ["Type"], ["Name"]) - print "Ok" + print("Ok") - print "Test 5:", + print("Test 5:", end=' ') try: # Note! This must raise KeyError - "Name" key is not listed fladm.load_from_file("test.txt", fladm.check_record, ["Type"], [""]) except KeyError: - print "Ok" + print("Ok") else: - print "Error!" + print("Error!") - print "Test 6:", + print("Test 6:", end=' ') fladm.load_from_file("test.txt", fladm.check_record, None, ["Type", "Name"]) - print "Ok" + print("Ok") - print "Test 7:", + print("Test 7:", end=' ') try: # Note! This must raise KeyError - "Error" key is listed in must field fladm.load_from_file("test.txt", fladm.check_record, ["Error"], ["Type"]) except KeyError: - print "Ok" + print("Ok") else: - print "Error!" + print("Error!") - print "Test 8:", + print("Test 8:", end=' ') datalist = fladm.load_from_file("test.txt", fladm.check_record, None, ["Type", "Name", "Error"]) - print "Ok" + print("Ok") - print "\nLast but not test: just printing loaded list" - print datalist + print("\nLast but not test: just printing loaded list") + print(datalist) print