示例#1
0
 def setUp(self):
     client = OrbitDbAPI(base_url=base_url, use_db_cache=False)
     self.kevalue_test = client.db('keyvalue_test',
                                   json={
                                       'create': True,
                                       'type': 'keyvalue'
                                   })
示例#2
0
 def setUp(self):
     self.client = OrbitDbAPI(base_url=base_url)
     self.kevalue_test = self.client.db('keyvalue_test',
                                        json={
                                            'create': True,
                                            'type': 'keyvalue'
                                        })
示例#3
0
 def setUp(self):
     client = OrbitDbAPI(base_url=base_url)
     self.counter_test = client.db('counter_test',
                                   json={
                                       'create': True,
                                       'type': 'counter'
                                   })
示例#4
0
 def setUp(self):
     client = OrbitDbAPI(base_url=base_url, use_db_cache=False)
     self.docstore_test = client.db('docstore_test',
                                    json={
                                        'create': True,
                                        'type': 'docstore'
                                    })
示例#5
0
 def setUp(self):
     client = OrbitDbAPI(base_url=base_url)
     self.kevalue_test = client.db('keyvalue_test',
                                   json={
                                       'create': True,
                                       'type': 'keyvalue'
                                   })
     self.feed_test = client.db('feed_test',
                                json={
                                    'create': True,
                                    'type': 'feed'
                                })
     self.event_test = client.db('event_test',
                                 json={
                                     'create': True,
                                     'type': 'eventlog'
                                 })
     self.docstore_test = client.db('docstore_test',
                                    json={
                                        'create': True,
                                        'type': 'docstore'
                                    })
     self.counter_test = client.db('counter_test',
                                   json={
                                       'create': True,
                                       'type': 'counter'
                                   })
示例#6
0
class SearchesTestCase(unittest.TestCase):
    def setUp(self):
        self.client = OrbitDbAPI(base_url=base_url)
        self.kevalue_test = self.client.db('keyvalue_test',
                                           json={
                                               'create': True,
                                               'type': 'keyvalue'
                                           })

    def runTest(self):
        self.kevalue_test.findPeers()
        searches = self.client.searches()
        self.assertGreater(len(searches), 0)
        self.assertGreater(
            len([
                s for s in searches
                if s.get('searchID') == self.kevalue_test.id
            ]), 0)

    def tearDown(self):
        self.kevalue_test.unload()
示例#7
0
class SearchPeersTestCase(unittest.TestCase):
    def setUp(self):
        self.client = OrbitDbAPI(base_url=base_url)
        self.kevalue_test = self.client.db(
            'zdpuAuSAkDDRm9KTciShAcph2epSZsNmfPeLQmxw6b5mdLmq5/keyvalue_test')

    def runTest(self):
        self.kevalue_test.findPeers(useCustomFindProvs=True)
        dbPeers = []
        count = 0
        while len(dbPeers) < 1:
            sleep(5)
            dbPeers = self.kevalue_test.getPeers()
            if count > 60: break
        self.assertGreater(len(dbPeers), 0)
示例#8
0
 def setUp(self):
     self.client = OrbitDbAPI(base_url=base_url)
     self.kevalue_test = self.client.db(
         'zdpuAuSAkDDRm9KTciShAcph2epSZsNmfPeLQmxw6b5mdLmq5/keyvalue_test')