Rev 6405: Bogus implementation passing smoke test in file:///home/vila/src/bzr/bugs/832046-globs-store-ordered/

Vincent Ladeuil v.ladeuil+lp at free.fr
Thu Dec 22 13:09:49 UTC 2011


At file:///home/vila/src/bzr/bugs/832046-globs-store-ordered/

------------------------------------------------------------
revno: 6405
revision-id: v.ladeuil+lp at free.fr-20111222130949-6p2y2t64dpu6vais
parent: v.ladeuil+lp at free.fr-20111222102342-4nr90uruiej3jhqy
committer: Vincent Ladeuil <v.ladeuil+lp at free.fr>
branch nick: 832046-globs-store-ordered
timestamp: Thu 2011-12-22 14:09:49 +0100
message:
  Bogus implementation passing smoke test
-------------- next part --------------
=== modified file 'bzrlib/tests/test_config.py'
--- a/bzrlib/tests/test_config.py	2011-12-22 10:23:42 +0000
+++ b/bzrlib/tests/test_config.py	2011-12-22 13:09:49 +0000
@@ -3255,7 +3255,7 @@
                            '/quux/quux'],
                           [section.id for _, section in store.get_sections()])
         matcher = config.LocationMatcher(store, '/foo/bar/quux')
-        sections = [section for s, section in matcher.get_sections()]
+        sections = [section for _, section in matcher.get_sections()]
         self.assertEquals(['/foo/bar', '/foo'],
                           [section.id for section in sections])
         self.assertEquals(['quux', 'bar/quux'],
@@ -3272,7 +3272,7 @@
         self.assertEquals(['/foo', '/foo/bar'],
                           [section.id for _, section in store.get_sections()])
         matcher = config.LocationMatcher(store, '/foo/bar/baz')
-        sections = [section for s, section in matcher.get_sections()]
+        sections = [section for _, section in matcher.get_sections()]
         self.assertEquals(['/foo/bar', '/foo'],
                           [section.id for section in sections])
         self.assertEquals(['baz', 'bar/baz'],
@@ -3303,6 +3303,32 @@
         self.assertEquals(expected_location, matcher.location)
 
 
+class TestGlobOrderedMatcher(TestStore):
+
+    def setUp(self):
+        super(TestGlobOrderedMatcher, self).setUp()
+        self.matcher = config.NameMatcher
+        # Any simple store is good enough
+        self.store = config.IniFileStore()
+
+    def assertSections(self, expected, location, content):
+        self.store._load_from_string(content)
+        matcher = config.GlobOrderedMatcher(self.store, location)
+        sections = list(matcher.get_sections())
+        self.assertLength(len(expected), sections)
+        self.assertEqual(expected, sections)
+        return sections
+
+    def test_empty(self):
+        self.assertSections([], self.test_dir, '')
+
+    def test_order_reversed(self):
+        pass
+
+    def test_unrelated_section_excluded(self):
+        pass
+
+
 class TestNameMatcher(TestStore):
 
     def setUp(self):
@@ -3334,25 +3360,6 @@
         self.assertLength(0, sections)
 
 
-class TestGlobOrderedMatcher(TestStore):
-
-    def setUp(self):
-        super(TestGlobOrderedMatcher, self).setUp()
-        self.matcher = config.NameMatcher
-        # Any simple store is good enough
-        self.store = config.IniFileStore()
-
-    def assertSections(self, expected, location, content):
-        self.store._load_from_string(content)
-        matcher = config.GlobOrderedMatcher(self.store, location)
-        sections = list(matcher.get_sections())
-        self.assertLength(len(expected), sections)
-        self.assertEqual(expected, sections)
-
-    def test_empty(self):
-        self.assertSections([], self.test_dir, '')
-
-
 class TestBaseStackGet(tests.TestCase):
 
     def setUp(self):



More information about the bazaar-commits mailing list