Esempio n. 1
0
 def setup(self):
     self.client = BirdsEyeClient(app.test_client())
     self.client.delete('/v1/sessions')
     self.client.delete('/v1/observations')
     self.client.delete('/v1/users')
     self.client.delete('/v1/species')
     self.client.post('/v1/users', {
         'credentials': {
             'email': '*****@*****.**'
         },
         'secret': '12345',
     })
     geometry = 'POLYGON((-81.3 37.2, -80.63 38.04, -80.02 37.49, -81.3 37.2))'  # noqa
     resp = assert_ok(
         201,
         self.client.post(
             '/v1/observations', {
                 'credentials': {
                     'email': '*****@*****.**'
                 },
                 'secret': '12345',
                 'geometry': geometry,
                 'media': {},
                 'properties': {
                     'vision_labels': [(0.99, 'bird'), (0.95, 'blue')]
                 },
             }))
     nt.assert_equal(resp.get('count'), '1')
     self.obs_id = resp.get('data')[0]
Esempio n. 2
0
 def setup(self):
     self.client = BirdsEyeClient(app.test_client())
     self.client.delete('/v1/sessions')
     self.client.delete('/v1/observations')
     self.client.delete('/v1/users')
     assert_ok(201, self.client.post('/v1/users', {
         'credentials': {'email': '*****@*****.**'},
         'secret': '12345',
     }))
Esempio n. 3
0
 def setup(self):
     self.client = BirdsEyeClient(app.test_client())
     self.client.delete('/v1/sessions')
     self.client.delete('/v1/observations')
     self.client.delete('/v1/users')
     self.client.delete('/v1/species')
     assert_ok(201, self.client.post('/v1/species', {
         'names': {'common': 'pidgeon', 'scientific': 'flying rat'},
         'labels': ['bird', 'gray'],
     }))
Esempio n. 4
0
 def setup(self):
     self.client = BirdsEyeClient(app.test_client())
     self.client.delete('/v1/users')
     self.client.delete('/v1/sessions')
     self.client.delete('/v1/observations')