bernhard: thuban/test test_stringrepresentation.py,1.1,1.2

cvs@intevation.de cvs at intevation.de
Wed Oct 19 10:08:31 CEST 2005


Author: bernhard

Update of /thubanrepository/thuban/test
In directory doto:/tmp/cvs-serv9907/test

Modified Files:
	test_stringrepresentation.py 
Log Message:
Preserving the internal encoding for the tests. 
This hopefully fixes subsequent tests when runnin all via runtests.py.


Index: test_stringrepresentation.py
===================================================================
RCS file: /thubanrepository/thuban/test/test_stringrepresentation.py,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- test_stringrepresentation.py	17 Oct 2005 21:31:43 -0000	1.1
+++ test_stringrepresentation.py	19 Oct 2005 08:08:29 -0000	1.2
@@ -22,10 +22,19 @@
 
 class TestInternalEncoding(unittest.TestCase):
     """Test around the thuban default encoding."""
+
+    def setUp(self):
+        """Save the old internal encoding, so we can restore it."""
+        self.saved_encoding=Thuban.get_internal_encoding()
+
+    def tearDown(self):
+        """Restore saved internal encoding."""
+        Thuban.set_internal_encoding(self.saved_encoding)
+
     def test_notice_bad_internalencoding(self):
-    	bad_encoding="this-never-is-a-valid-encoding"
-    	self.assertRaises(LookupError, 
-			Thuban.set_internal_encoding,bad_encoding)
+        bad_encoding="this-never-is-a-valid-encoding"
+        self.assertRaises(LookupError, 
+            Thuban.set_internal_encoding,bad_encoding)
 
 if __name__ == "__main__":
     support.run_tests()





More information about the Thuban-devel mailing list

This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)