changeset 4844:193bbbdd0ace

Groups2009: Cosmetic changes in MoinMoin.formatter.groups tests: variable and method names.
author Dmitrijs Milajevs <dimazest@gmail.com>
date Sat, 11 Jul 2009 12:33:43 +0200
parents d8093123a1bd
children 916c28ef9026
files MoinMoin/formatter/_tests/test_groups.py
diffstat 1 files changed, 93 insertions(+), 93 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/formatter/_tests/test_groups.py	Fri Jul 10 18:09:15 2009 +0200
+++ b/MoinMoin/formatter/_tests/test_groups.py	Sat Jul 11 12:33:43 2009 +0200
@@ -12,99 +12,7 @@
 
 class TestGroupFormatter(object):
 
-    def test_CamelCase(self):
-        text = """
- * CamelCase
-"""
-        groups = list(self.get_group(text))
-        assert len(groups) == 1
-        assert u'CamelCase' in groups
-
-    def test_extended_name(self):
-        text = """
- * extended name
-"""
-        groups = list(self.get_group(text))
-        assert len(groups) == 1
-        assert u'extended name' in groups
-
-    def test_extended_link(self):
-        text = """
- * [[extended link]]
-"""
-        groups = list(self.get_group(text))
-        assert len(groups) == 1
-        assert u'extended link' in groups
-
-    def test_extended_link_with_label(self):
-        text = """
- * [[extended link| label]]
-"""
-        groups = list(self.get_group(text))
-        assert len(groups) == 1
-        assert u'label' in groups
-
-    def test_extended_link_and_text(self):
-        text = """
- * [[extended link]] other text
- * other text [[extended link]]
- * other text [[extended link]] other text
-
-"""
-        groups = list(self.get_group(text))
-        assert len(groups) == 3
-        assert u'extended link other text' in groups
-        assert u'other text extended link' in groups
-        assert u'other text extended link other text' in groups
-
-    def test_ignore_not_first_level_list(self):
-        text = """
- * first level
-  * second level
-   * [[SomeLink]]
-    * forth level
-     * and then some...
- * again first level
-"""
-        groups = list(self.get_group(text))
-        assert len(groups) == 2
-        assert 'first level' in groups
-        assert 'again first level' in groups
-
-    def test_intended_list(self):
-        text = """
-    * first level
-     * second level
-      * [[SomeLink]]
-       * forth level
-        * and then some...
-    * again first level
-"""
-        groups = list(self.get_group(text))
-        assert len(groups) == 2
-        assert 'first level' in groups
-        assert 'again first level' in groups
-
-    def test_ignore_other(self):
-        text = """
-= ignore this =
- * take this
-
-Ignore previous line and this text.
-"""
-        groups = list(self.get_group(text))
-        assert len(groups) == 1
-        assert u'take this' in groups
-
-    def test_strip_whitespace(self):
-        text = """
- *   take this
-"""
-        groups = list(self.get_group(text))
-        assert len(groups) == 1
-        assert u'take this' in groups
-
-    def get_group(self, text):
+    def get_members(self, text):
         request = self.request
         formatter = Formatter(self.request)
 
@@ -116,5 +24,97 @@
 
         return formatter.members
 
+    def test_CamelCase(self):
+        text = """
+ * CamelCase
+"""
+        members = self.get_members(text)
+        assert len(members) == 1
+        assert u'CamelCase' in members
+
+    def test_extended_name(self):
+        text = """
+ * extended name
+"""
+        members = self.get_members(text)
+        assert len(members) == 1
+        assert u'extended name' in members
+
+    def test_extended_link(self):
+        text = """
+ * [[extended link]]
+"""
+        members = self.get_members(text)
+        assert len(members) == 1
+        assert u'extended link' in members
+
+    def test_extended_link_with_label(self):
+        text = """
+ * [[extended link| label]]
+"""
+        members = self.get_members(text)
+        assert len(members) == 1
+        assert u'label' in members
+
+    def test_extended_link_and_text(self):
+        text = """
+ * [[extended link]] other text
+ * other text [[extended link]]
+ * other text [[extended link]] other text
+
+"""
+        members = self.get_members(text)
+        assert len(members) == 3
+        assert u'extended link other text' in members
+        assert u'other text extended link' in members
+        assert u'other text extended link other text' in members
+
+    def test_ignore_not_first_level_list(self):
+        text = """
+ * first level
+  * second level
+   * [[SomeLink]]
+    * forth level
+     * and then some...
+ * again first level
+"""
+        members = self.get_members(text)
+        assert len(members) == 2
+        assert 'first level' in members
+        assert 'again first level' in members
+
+    def test_intended_list(self):
+        text = """
+    * first level
+     * second level
+      * [[SomeLink]]
+       * forth level
+        * and then some...
+    * again first level
+"""
+        members = self.get_members(text)
+        assert len(members) == 2
+        assert 'first level' in members
+        assert 'again first level' in members
+
+    def test_ignore_other(self):
+        text = """
+= ignore this =
+ * take this
+
+Ignore previous line and this text.
+"""
+        members = self.get_members(text)
+        assert len(members) == 1
+        assert u'take this' in members
+
+    def test_strip_whitespace(self):
+        text = """
+ *   take this
+"""
+        members = self.get_members(text)
+        assert len(members) == 1
+        assert u'take this' in members
+
 coverage_modules = ['MoinMoin.formtter.groups']