Beispiel #1
0
 def tearDownClass(cls):
     fluid.login(USERNAME, PASSWORD)
     # create necessary tags
     for cls in [Person, Education, Work]:
         for tag in cls.TAGS:
             fluid.delete('/tags/test/%s' % tag)
     fluid.logout()
Beispiel #2
0
 def update_from_form(cls, form, user, password):
     uids = form.skills.data.split(',')
     fluid.login(user, password)
     fluid.post('/tags/%s' % user, {'name': 'skill',
                                    'description': 'My skills',
                                    'indexed': False})
     fluid.delete('/values', query="has %s/skill" % user,
                             tags=["%s/skill" % user])
     for uid in uids:
         resp = fluid.put('/objects/%s/%s/skill' % (uid, user), None)
         if not resp or (resp and resp.status_code != 204):
             logging.warning("PUT /objects/%s/%s/skill failed!" % (uid,user))
     fluid.logout()
Beispiel #3
0
 def _set_values(self, tags, user, password):
     fluid.login(user, password)
     try:
         body={}
         for tag, val in tags.iteritems():
             body['%s/%s' % (user, tag)] = {'value' : val}
         query = 'fluiddb/about="%s"' % self.about
         resp = fluid.put('/values', body={
             'queries': [
                 [ query, body ]
                 ]
             }, async=True)
         return resp
     finally:
         fluid.logout()
Beispiel #4
0
 def setUpClass(cls):
     fluid.login(USERNAME, PASSWORD)
     # create necessary tags
     rpcs = []
     for cls in [Person, Education, Work]:
         for tag in cls.TAGS:
             rpc = fluid.post('/tags/test', async=True,
                              body={'name' : tag,
                                    'description' : None,
                                    'indexed' : True})
             rpcs.append(rpc)
     for rpc in rpcs:
         resp = fluid.result(rpc)
         if resp.status_code not in [201, 412]:
             print 'Failed to create tag: %s' % tag
             print resp.headers
             sys.exit(1)
     fluid.logout()
Beispiel #5
0
def create_object(about):
    fluid.login('fluidcv', app.config['FLUIDCV_PASSWORD'])
    resp = fluid.post('/objects', about)
    fluid.logout()
    return resp
Beispiel #6
0
 def tearDown(self):
     fluid.logout()