#! /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