Update VCard unittests to use XML import and command line config

svn: r16823
This commit is contained in:
Michiel Nauta
2011-03-13 22:07:16 +00:00
parent a75b8399b0
commit efbff4178a
2 changed files with 213 additions and 70 deletions

View File

@@ -25,8 +25,6 @@ Unittest of import of VCard
To be called from src directory.
"""
#TODO id number depend on user format.
# in case of a failing test, add True as last parameter to do_test to see the output.
from cStringIO import StringIO
@@ -98,8 +96,9 @@ class VCardCheck(unittest.TestCase):
buf = libxml2.createOutputBuffer(expect_canonical_strfile, 'UTF-8')
self.string2canonicalxml(expect_str, buf)
process = subprocess.Popen('python gramps.py -i - -f vcf -e - -f gramps',
stdin=subprocess.PIPE, stdout=subprocess.PIPE, shell=True)
process = subprocess.Popen('python gramps.py '
'--config=preferences.eprefix:DEFAULT -i - -f vcf -e - -f gramps',
stdin=subprocess.PIPE, stdout=subprocess.PIPE, shell=True)
result_str, err_str = process.communicate(input_str)
if err_str:
print err_str