changeset 2826:45b438c119d7

merged main
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Mon, 10 Sep 2007 22:47:01 +0200
parents e726619bfe6c (current diff) 7e40c2e6d84a (diff)
children c61cd68592c2 c4ab7c81146d
files
diffstat 1 files changed, 12 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/_tests/test_error.py	Mon Sep 10 22:46:41 2007 +0200
+++ b/MoinMoin/_tests/test_error.py	Mon Sep 10 22:47:01 2007 +0200
@@ -2,28 +2,30 @@
 """
     MoinMoin - MoinMoin.error Tests
 
-    @copyright: 2003-2004 by Nir Soffer <nirs AT freeshell DOT org>
+    @copyright: 2003-2004 by Nir Soffer <nirs AT freeshell DOT org>,
+                2007 by MoinMoin:ThomasWaldmann
     @license: GNU GPL, see COPYING for details.
 """
 
-import unittest # LEGACY UNITTEST, PLEASE DO NOT IMPORT unittest IN NEW TESTS, PLEASE CONSULT THE py.test DOCS
+import py
+
 from MoinMoin import error
 
 
-class TestEncoding(unittest.TestCase):
+class TestEncoding(object):
     """ MoinMoin errors do work with unicode transparently """
 
     def testCreateWithUnicode(self):
         """ error: create with unicode """
         err = error.Error(u'טעות')
-        self.assertEqual(unicode(err), u'טעות')
-        self.assertEqual(str(err), 'טעות')
+        assert unicode(err) == u'טעות'
+        assert str(err) == 'טעות'
 
     def testCreateWithEncodedString(self):
         """ error: create with encoded string """
         err = error.Error('טעות')
-        self.assertEqual(unicode(err), u'טעות')
-        self.assertEqual(str(err), 'טעות')
+        assert unicode(err) == u'טעות'
+        assert str(err) == 'טעות'
 
     def testCreateWithObject(self):
         """ error: create with any object """
@@ -34,14 +36,14 @@
                 return 'טעות'
 
         err = error.Error(Foo())
-        self.assertEqual(unicode(err), u'טעות')
-        self.assertEqual(str(err), 'טעות')
+        assert unicode(err) == u'טעות'
+        assert str(err) == 'טעות'
 
     def testAccessLikeDict(self):
         """ error: access error like a dict """
         test = 'value'
         err = error.Error(test)
-        self.assertEqual('%(message)s' % err, test)
+        assert '%(message)s' % err == test
 
 coverage_modules = ['MoinMoin.error']