From 3bcfdcff60d51a2251ed18dba40cda5b6b47d91a Mon Sep 17 00:00:00 2001 From: prculley Date: Mon, 27 Jun 2016 16:44:45 -0500 Subject: [PATCH] fix vcf filter and tweak test_imports for better pythonic --- gramps/plugins/test/test_exports.py | 11 ++++++++++- gramps/plugins/test/test_imports.py | 2 +- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/gramps/plugins/test/test_exports.py b/gramps/plugins/test/test_exports.py index f6c98d4b0..6f5d26b8b 100644 --- a/gramps/plugins/test/test_exports.py +++ b/gramps/plugins/test/test_exports.py @@ -148,7 +148,16 @@ def vcffilt(line): The differences are not functional, but are related to changes in Gramps version. """ - return False if line.startswith('PRODID:') else True + diftyp = line[0] + if diftyp == '@': + retval = False + elif diftyp == ' ': + retval = False + elif 'PRODID:' in line: # Gramps version is on these lines + retval = False + else: + retval = True + return retval class ExportControl(unittest.TestCase): diff --git a/gramps/plugins/test/test_imports.py b/gramps/plugins/test/test_imports.py index 3b866189e..dae89841e 100644 --- a/gramps/plugins/test/test_imports.py +++ b/gramps/plugins/test/test_imports.py @@ -243,7 +243,7 @@ else: _tstfiles = [] for _tstfile in os.listdir(TEST_DIR): (fname, ext) = os.path.splitext(os.path.basename(_tstfile)) - if ext == ".gramps" or ext == ".difs" or ext == ".bak" \ + if ext in (".gramps", ".difs", ".bak") \ or not fname.startswith("imp_"): continue test_func = make_tst_function(_tstfile, fname)