Jean-Tiare Le Bigot avatar Jean-Tiare Le Bigot committed e2fcd40

fix #5: do not require user credentials in boto patch

Comments (0)

Files changed (4)

 - pre-instanciate DynamoDB as dynamodb
 - UpdateItem failed to save keys properly
 - integrate boto dynamodb integration tests to test suite (disabled unless '--no-skip')
+- do not require (real) user credentials in boto patch version (#5)
 
 Upgrade
 -------

ddbmock/__init__.py

 from pyramid.config import Configurator
 from ddbmock.router.pyramid import pyramid_router
 
+def noop(*args, **kwargs): pass
+
 # Pyramid entry point
 def main(global_config, **settings):
     """ This function returns a Pyramid WSGI application.
     from boto.dynamodb.layer1 import Layer1
     from router.boto import boto_router
     Layer1.make_request = boto_router
+    Layer1.__init__ = noop  # bypass authentication
     return boto.connect_dynamodb()

ddbmock/config.py

 
 ### Storage specific settings ###
 
-# Storage engine ro use ('memory' or 'sqlite')
+# Storage engine to use ('memory' or 'sqlite')
 STORAGE_ENGINE_NAME = 'memory'
 # SQLite database location
 STORAGE_SQLITE_FILE = 'dynamo.db'

tests/integration/test_boto.py

     layer1_file.close()
     layer2_file.close()
 else:
-    print "Boto Integration tests are slow hence dusabled by default, enable them with '--no-skip'"
+    print "Boto Integration tests are slow hence disabled by default, enable them with '--no-skip'"
 
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.