| /trunk/apptestsuite/client/validator/runtests.py r0 | /trunk/apptestsuite/client/validator/runtests.py r973 | ||
| 1 | from subprocess import Popen, PIPE | ||
|---|---|---|---|
| 2 | import unittest | ||
| 3 | import appclienttest | ||
| 4 | |||
| 5 | class Test(unittest.TestCase): | ||
| 6 | def testNonWellFormed(self): | ||
| 7 | """ | ||
| 8 | Non-WellFormed output should be caught | ||
| 9 | and a log message recording the malformed | ||
| 10 | XML should be produced. | ||
| 11 | """ | ||
| 12 | output = Popen(["python", "appclienttest.py", "--quiet", "--playback=./rawtestdata/invalid-service/"], stdout=PIPE).communicate()[0] | ||
| 13 | parsed = [l.split(":") for l in output.splitlines()] | ||
| 14 | msg_count = {} | ||
| 15 | for code, msg in parsed: | ||
| 16 | msg_count[code] = msg_count.get(code, 0) + 1 | ||
| 17 | self.assertTrue(["Error", appclienttest.REPRESENTATION] in parsed) | ||
| 18 | self.assertTrue(["Log", "Response"] in parsed) | ||
| 19 | |||
| 20 | if __name__ == "__main__": | ||
| 21 | unittest.main() | ||
| 22 | |||