changeset 170:1e0e769ced2e

must discard old output for each new test
author catherine@Elli.myhome.westell.com
date Thu, 23 Oct 2008 13:05:03 -0400
parents 1736fd6ae3e8
children d6652b33ce53
files sqlpython/test_sqlpyPlus.py sqlpython/test_sqlpyPlus.txt
diffstat 2 files changed, 61 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/sqlpython/test_sqlpyPlus.py	Wed Oct 22 22:59:47 2008 -0400
+++ b/sqlpython/test_sqlpyPlus.py	Thu Oct 23 13:05:03 2008 -0400
@@ -13,7 +13,9 @@
         self.testsession.onecmd(commandtext)
         falseStdOut.seek(0)
         result = falseStdOut.read()
-        self.assertEqual(expected, result)
+        falseStdOut.close()
+        falseStdOut = tempfile.TemporaryFile()
+        self.assertEqual(expected.strip(), result.strip())
     def testall(self):
         for directive in self.directives:
             (command, result) = directive.groups()
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sqlpython/test_sqlpyPlus.txt	Thu Oct 23 13:05:03 2008 -0400
@@ -0,0 +1,58 @@
+testdata@orcl> select * from species;
+
+ID NAME  
+-- ------
+ 0 turtle
+ 1 python
+ 2 parrot
+
+3 rows selected.
+
+testdata@orcl> select *
+> from species;
+
+ID NAME  
+-- ------
+ 0 turtle
+ 1 python
+ 2 parrot
+
+3 rows selected.
+
+testdata@orcl> select * from species\h
+
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+  <head>
+    <title>species</title>
+    <meta http-equiv="content-type" content="text/html;charset=utf-8"/>
+  </head>
+  <body>
+    <table id="species" summary="Result set from query on table species">
+      <tr>
+        <th id="header_id">
+          id
+        </th><th id="header_name">
+          name
+        </th>
+      </tr>
+      <tr>
+        <td headers="header_id">
+          0
+        </td><td headers="header_id">
+          turtle
+        </td>
+      </tr><tr>
+        <td headers="header_name">
+          1
+        </td><td headers="header_name">
+          python
+        </td>
+      </tr>
+    </table>
+  </body>
+</html>
+
+3 rows selected.
+
+testdata@orcl>