コード例 #1
0
ファイル: test_memon.py プロジェクト: so-sure/MEMon
    def tearDown(self):
        from ddbmock.database.db import dynamodb
        from ddbmock import clean_boto_patch

        # Do a full database wipe
        dynamodb.hard_reset()

        # Remove the patch from Boto code (if any)
        clean_boto_patch()
コード例 #2
0
ファイル: test_memon.py プロジェクト: urg/MEMon
    def tearDown(self):
        from ddbmock.database.db import dynamodb
        from ddbmock import clean_boto_patch

        # Do a full database wipe
        dynamodb.hard_reset()

        # Remove the patch from Boto code (if any)
        clean_boto_patch()
コード例 #3
0
    def test_connect_boto_patch_network(self):
        from ddbmock import connect_boto_network, clean_boto_patch

        clean_boto_patch()
        db = connect_boto_network(HOST, PORT)

        self.assertEqual('ddbmock', db.layer1.region.name)
        self.assertEqual(ENDPOINT, db.layer1.region.endpoint)
        self.assertEqual(ENDPOINT, db.layer1.host)
        self.assertEqual(PORT, db.layer1.port)
        self.assertFalse(db.layer1.is_secure)
コード例 #4
0
ファイル: test_ddbmock_init.py プロジェクト: lshift/ddbmock
    def test_connect_boto_patch_network(self):
        try:
            socket.gethostbyname(HOST)
        except Exception:
            self.skipTest("Can't connect to test host: %s" % HOST)

        from ddbmock import connect_boto_network, clean_boto_patch

        clean_boto_patch()
        db = connect_boto_network(HOST, PORT)

        self.assertEqual('ddbmock', db.layer1.region.name)
        self.assertEqual(ENDPOINT, db.layer1.region.endpoint)
        self.assertEqual(ENDPOINT, db.layer1.host)
        self.assertEqual(PORT, db.layer1.port)
        self.assertFalse(db.layer1.is_secure)
コード例 #5
0
ファイル: test_scan.py プロジェクト: pombredanne/ddbmock
 def tearDown(self):
     from ddbmock.database.db import dynamodb
     from ddbmock import clean_boto_patch
     dynamodb.hard_reset()
     clean_boto_patch()
コード例 #6
0
ファイル: test_boto.py プロジェクト: dekked/dynamodb-mock
import sys

# Just, skip this unless "--no-skip"
if '--no-skip' in sys.argv:
    import os, imp, boto, unittest
    from ddbmock import connect_boto_patch, clean_boto_patch

    # Load boto dir
    boto_dir = os.path.realpath(boto.__file__+'/../../')

    # Plug patch
    connect_boto_patch()

    # Import boto test modules, pretending they are belonging to us. see hack in tests.unit.__init__
    layer1_file, _, desc1 = imp.find_module('test_layer1', [boto_dir+'/tests/integration/dynamodb'])
    layer2_file, _, desc2 = imp.find_module('test_layer2', [boto_dir+'/tests/integration/dynamodb'])
    layer1_module = imp.load_module('test_layer1', layer1_file, boto_dir, desc1)
    layer2_module = imp.load_module('test_layer2', layer2_file, boto_dir, desc2)

    # Finally, import the tests class, that's enough to let the magic happen !
    DynamoDBLayer1Test = layer1_module.DynamoDBLayer1Test
    DynamoDBLayer2Test = layer2_module.DynamoDBLayer2Test

    # clean up
    layer1_file.close()
    layer2_file.close()
    clean_boto_patch()
else:
    print "Boto Integration tests are slow hence disabled by default, enable them with '--no-skip'"

コード例 #7
0
ファイル: test_ddbmock_init.py プロジェクト: lshift/ddbmock
 def tearDown(self):
     from ddbmock import clean_boto_patch
     clean_boto_patch()
コード例 #8
0
 def tearDown(self):
     from ddbmock import clean_boto_patch
     clean_boto_patch()