aboutsummaryrefslogtreecommitdiff
path: root/rpkid/tests/smoketest.py
diff options
context:
space:
mode:
authorRob Austein <sra@hactrn.net>2011-12-14 04:01:52 +0000
committerRob Austein <sra@hactrn.net>2011-12-14 04:01:52 +0000
commitfc2941d92286ca1e01400c3a46abbd88b411f6f8 (patch)
tree0affd828b74cf0a33f0a928662666e191c0dc8f9 /rpkid/tests/smoketest.py
parent3437696dc1da196ba5f5cbf747c576377250b495 (diff)
Start hacking replacement for myrpki comamnd (rpkic) which uses the
new Django-model-based entitydb and IRDB. svn path=/branches/tk100/; revision=4121
Diffstat (limited to 'rpkid/tests/smoketest.py')
-rw-r--r--rpkid/tests/smoketest.py12
1 files changed, 4 insertions, 8 deletions
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 ]