Example #1
0
    def test_make_a_gateway(self):

        bucket_name = "test_bucket"

        couchbase_utils.make_a_bucket(COUCHBASE_LOCAL_URL, COUCHBASE_ADMIN, COUCHBASE_ADMIN_PASSWORD, bucket_name, force=True)

        try:
            couchbase_utils.make_a_gateway(COUCHDB_SYNC_ADMIN_URL, "test_gateway", COUCHBASE_LOCAL_URL, bucket_name, "function(doc) {channel(doc.channels);}", force=True)
            couchbase_utils.delete_a_gateway(COUCHDB_SYNC_ADMIN_URL, "test_gateway")

        finally:
            couchbase_utils.delete_a_bucket(COUCHBASE_LOCAL_URL, COUCHBASE_ADMIN, COUCHBASE_ADMIN_PASSWORD, bucket_name)
Example #2
0
    def test_make_and_delete_a_bucket(self):

        bucket_name = "test_bucket"
        origional_count = couchbase_utils.number_of_buckets(COUCHBASE_LOCAL_URL, COUCHBASE_ADMIN, COUCHBASE_ADMIN_PASSWORD)

        couchbase_utils.make_a_bucket(COUCHBASE_LOCAL_URL, COUCHBASE_ADMIN, COUCHBASE_ADMIN_PASSWORD, bucket_name)
        count = couchbase_utils.number_of_buckets(COUCHBASE_LOCAL_URL, COUCHBASE_ADMIN, COUCHBASE_ADMIN_PASSWORD)
        self.assertEquals(count, origional_count + 1)


        couchbase_utils.delete_a_bucket(COUCHBASE_LOCAL_URL, COUCHBASE_ADMIN, COUCHBASE_ADMIN_PASSWORD, bucket_name)
        count = couchbase_utils.number_of_buckets(COUCHBASE_LOCAL_URL, COUCHBASE_ADMIN, COUCHBASE_ADMIN_PASSWORD)
        self.assertEquals(count, origional_count)