import pycb
import unittest
import requests
import json
import time


def bucket_list():
    bucketList = []
    r = requests.get("http://localhost:8091/pools/default/buckets")
    for bucket in r.json():
        bucketList.append(bucket['name'])

    return bucketList


class TestPycb(unittest.TestCase):
    @classmethod
    def setUpClass(self):
        self.cb = pycb.Couchbase("localhost", "Administrator", "password")
        self.testBucket = self.cb.create("test")

    @classmethod
    def tearDownClass(self):
        self.cb.delete("test")