changeset 2819:48f3e2ab7365

tests: convert wikisync tests to py.test
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Mon, 10 Sep 2007 20:30:48 +0200
parents 7fceb3588211
children 97645f8f7747
files MoinMoin/_tests/test_wikisync.py
diffstat 1 files changed, 5 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/_tests/test_wikisync.py	Mon Sep 10 20:16:33 2007 +0200
+++ b/MoinMoin/_tests/test_wikisync.py	Mon Sep 10 20:30:48 2007 +0200
@@ -6,34 +6,31 @@
     @license: GNU GPL, see COPYING for details.
 """
 
-from unittest import TestCase # LEGACY UNITTEST, PLEASE DO NOT IMPORT unittest IN NEW TESTS, PLEASE CONSULT THE py.test DOCS
-
 import py
 
 from MoinMoin.PageEditor import PageEditor
-
 from MoinMoin.wikisync import TagStore, BOTH
 
 
-class TestUnsafeSync(TestCase):
+class TestUnsafeSync(object):
     """ Tests various things related to syncing. Note that it is not possible
         to create pages without cluttering page revision currently, so we have to use
         the testwiki. """
 
-    def setUp(self):
+    def setup_method(self, method):
         if not getattr(self.request.cfg, 'is_test_wiki', False):
             py.test.skip('This test needs to be run using the test wiki.')
         self.page = PageEditor(self.request, "FrontPage")
 
     def testBasicTagThings(self):
         tags = TagStore(self.page)
-        self.assert_(not tags.get_all_tags())
+        assert not tags.get_all_tags()
         tags.add(remote_wiki="foo", remote_rev=1, current_rev=2, direction=BOTH, normalised_name="FrontPage")
         tags = TagStore(self.page) # reload
         dummy = repr(tags.get_all_tags()) # this should not raise
-        self.assert_(tags.get_all_tags()[0].remote_rev == 1)
+        assert tags.get_all_tags()[0].remote_rev == 1
 
-    def tearDown(self):
+    def teardown_method(self, method):
         tags = TagStore(self.page)
         tags.clear()