Skip to content

Commit b5ca37c

Browse files
committed
Added frubi's test case
1 parent 5a0119a commit b5ca37c

File tree

3 files changed

+11
-3
lines changed

3 files changed

+11
-3
lines changed

test/cases/SystemParameter.json

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"cmd_args": ["-s", "UTF-16LE", "-R", "data/SystemParameter.dbf"],
3+
"head": "BEGIN;\nSET statement_timeout=60000; DROP TABLE IF EXISTS systemparameter; SET statement_timeout=0;\nCREATE TABLE systemparameter (paraname VARCHAR(64), paravalue VARCHAR(64));\n\\COPY systemparameter FROM STDIN\nModelVersion\t6\nVersionIncrement\t1\nProductVersion\tXXXXXXXX\nExporterVersion\tXXXXXXX-XXXXXXXX-XXXXXX\nExportTimestamp\t11/11/2015 10:33:15\nUserName\tppadmin\nDBUsername\tppadmin\nDBName\tXXXXXXXXXXXX\nHostName\tXXXXXXXX\nGDMBaseVersion\tXXXXXXXX\nExportMode\t1FileProKnoten\nExportNr\t5012\nExportKurzBez\tXXXX\nExportLangBez\tXXXXXXXXXXXXXXXXXXXXXX\n\\.\nCOMMIT;\n",
4+
"length": 547,
5+
"md5": "02d6082e6de64420bf46e3a972c7a954"
6+
}

test/cases/data/SystemParameter.dbf

2.12 KB
Binary file not shown.

test/runtests.py

+5-3
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ def check_head(expected):
3131
raise ValueError({'error': 'short read', 'expected': length, 'actual': len(body)})
3232
body += data
3333
if len(body) >= length:
34-
actual = body[:length]
35-
if expected != actual.decode():
34+
actual = body[:length].decode()
35+
if expected != actual:
3636
raise TestError('unequal head', expected, actual)
3737
LOGGER.info('passed the header check')
3838
break
@@ -138,7 +138,9 @@ def run_test(pgdbf_path, config):
138138
if not isinstance(args, list):
139139
args = [args]
140140

141-
command = Popen([pgdbf_path] + args, stdout=PIPE, stderr=STDOUT)
141+
args.insert(0, pgdbf_path)
142+
LOGGER.debug('running %s', args)
143+
command = Popen(args, stdout=PIPE, stderr=STDOUT)
142144
while True:
143145
chunk = command.stdout.read(128 * 1024)
144146
if not chunk:

0 commit comments

Comments
 (0)