Commits

Thomas Waldmann committed 90df744

more name-related code/test fixes

Comments (0)

Files changed (4)

MoinMoin/_tests/test_test_environ.py

         itemname = u"this item shouldn't exist yet"
         assert not storage.has_item(itemname)
         item = storage[itemname]
-        new_rev = item.store_revision({NAME: itemname, CONTENTTYPE: u'text/plain'}, StringIO(''))
+        new_rev = item.store_revision({NAME: [itemname, ], CONTENTTYPE: u'text/plain'}, StringIO(''))
         assert storage.has_item(itemname)
 
 

MoinMoin/storage/middleware/_tests/test_indexing.py

 from MoinMoin.storage.stores.memory import BytesStore as MemoryBytesStore
 from MoinMoin.storage.stores.memory import FileStore as MemoryFileStore
 from MoinMoin.storage import create_simple_mapping
-from MoinMoin.storage.middleware import routing
 
 
 def dumper(indexer, idx_name):

MoinMoin/storage/middleware/indexing.py

                  keys.ADDRESS: remote_addr,
                  keys.USERID: userid,
                  keys.WIKINAME: wikiname,
-                 keys.NAMESPACE: u'',
+                 keys.NAMESPACE: None,
                  keys.ITEMID: self.itemid, # real itemid or None
                  'contenttype_current': contenttype_current,
                  'contenttype_guessed': contenttype_guessed,

MoinMoin/storage/middleware/routing.py

             # if there is no NAMESPACE in metadata, we assume that the NAME
             # is fully qualified and determine the namespace from it:
             fq_names = meta[NAME]
-            if not isinstance(fq_names, list):
-                fq_names = [fq_names]
+            assert isinstance(fq_names, list)
             backend_name, item_names, namespace = self._get_backend(fq_names)
             # side effect: update the metadata with namespace and short item name (no ns)
             meta[NAMESPACE] = namespace