From fc2941d92286ca1e01400c3a46abbd88b411f6f8 Mon Sep 17 00:00:00 2001 From: Rob Austein Date: Wed, 14 Dec 2011 04:01:52 +0000 Subject: Start hacking replacement for myrpki comamnd (rpkic) which uses the new Django-model-based entitydb and IRDB. svn path=/branches/tk100/; revision=4121 --- rpkid/tests/smoketest.py | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'rpkid/tests/smoketest.py') diff --git a/rpkid/tests/smoketest.py b/rpkid/tests/smoketest.py index 189f6d6a..4c888f67 100644 --- a/rpkid/tests/smoketest.py +++ b/rpkid/tests/smoketest.py @@ -1269,16 +1269,12 @@ def mangle_sql(filename): """ Mangle an SQL file into a sequence of SQL statements. """ - - # There is no pretty way to do this. Just shut your eyes, it'll be - # over soon. - + words = [] f = open(filename) - statements = " ".join(" ".join(word for word in line.expandtabs().split(" ") if word) - for line in [line.strip(" \t\n") for line in f.readlines()] - if line and not line.startswith("--")).rstrip(";").split(";") + for line in f: + words.extend(line.partition("--")[0].split()) f.close() - return [stmt.strip() for stmt in statements] + return " ".join(words).strip(";").split(";") bpki_cert_fmt_1 = '''\ [ req ] -- cgit v1.2.3