← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] lp:~stub/launchpad/swift-librarian into lp:launchpad

 

Stuart Bishop has proposed merging lp:~stub/launchpad/swift-librarian into lp:launchpad with lp:~stub/launchpad/mock-swift as a prerequisite.

Commit message:
Fix broken test_gc.py

Requested reviews:
  Stuart Bishop (stub)
Related bugs:
  Bug #1257636 in Launchpad itself: "Swift backend for Librarian storage"
  https://bugs.launchpad.net/launchpad/+bug/1257636

For more details, see:
https://code.launchpad.net/~stub/launchpad/swift-librarian/+merge/197701

test_gc is busted. Fix it.
-- 
https://code.launchpad.net/~stub/launchpad/swift-librarian/+merge/197701
Your team Launchpad code reviewers is subscribed to branch lp:launchpad.
=== modified file 'lib/lp/services/librarianserver/tests/test_gc.py'
--- lib/lp/services/librarianserver/tests/test_gc.py	2013-12-04 06:44:07 +0000
+++ lib/lp/services/librarianserver/tests/test_gc.py	2013-12-04 12:04:08 +0000
@@ -90,10 +90,12 @@
                 if not os.path.exists(os.path.dirname(path)):
                     os.makedirs(os.path.dirname(path))
                 content_text = '{0} content'.format(content.id)
-                content_md5 = hashlib.md5(content_text).hexdigest()
                 open(path, 'w').write(content_text)
                 os.utime(path, (0, 0))  # Ancient past, never considered new.
-                content.md5 = content_md5  # Only using md5 checks.
+                content.md5 = hashlib.md5(content_text).hexdigest()
+                content.sha1 = hashlib.sha1(content_text).hexdigest()
+                content.sha256 = hashlib.sha256(content_text).hexdigest()
+                content.filesize = len(content_text)
         transaction.commit()
 
         self.con = connect(


References