4
4
from app .main import Biolucida
5
5
6
6
7
- # class BiolucidaTestCase(unittest.TestCase):
7
+ class BiolucidaTestCase (unittest .TestCase ):
8
8
9
- # def test_authenticate(self):
10
- # bl = Biolucida()
9
+ def test_authenticate (self ):
10
+ bl = Biolucida ()
11
+ authenticate_biolucida ()
12
+ self .assertNotEqual ('' , bl .token ())
11
13
12
- # authenticate_biolucida()
14
+ def test_get_image_info (self ):
15
+ image_info = image_info_by_image_id (1170 )
16
+ self .assertEqual ('success' , image_info ['status' ])
17
+ self .assertEqual ('115' , image_info ['collection_id' ])
13
18
14
- # self.assertNotEqual('', bl.token())
19
+ def test_get_thumbnail (self ):
20
+ thumbnail = thumbnail_by_image_id (1170 )
21
+ self .assertTrue (thumbnail .startswith (b'/9j/4AAQSkZJRgABAQAAAQ' ))
15
22
16
- # def test_get_image_info(self):
17
- # image_info = image_info_by_image_id(1170)
18
- # self.assertEqual('success', image_info['status'])
19
- # self.assertEqual('115', image_info['collection_id'])
23
+ def test_old_token (self ):
24
+ bl = Biolucida ()
25
+ bl .set_token ('a20f155e818fbfebbb03275f30f87697' )
26
+ thumbnail = thumbnail_by_image_id (1170 )
27
+ self .assertTrue (thumbnail .startswith (b'/9j/4AAQSkZJRgABAQAAAQ' ))
20
28
21
- # def test_get_thumbnail(self):
22
- # thumbnail = thumbnail_by_image_id(1170)
23
- # self.assertTrue(thumbnail.startswith(b'/9j/4AAQSkZJRgABAQAAAQ'))
29
+ def test_bad_token (self ):
30
+ bl = Biolucida ()
31
+ bl .set_token ('bad_token' )
32
+ thumbnail = thumbnail_by_image_id (1170 )
33
+ self .assertTrue (thumbnail .startswith (b'/9j/4AAQSkZJRgABAQAAAQ' ))
24
34
25
- # def test_old_token(self):
26
- # bl = Biolucida()
27
- # bl.set_token('a20f155e818fbfebbb03275f30f87697')
28
- # thumbnail = thumbnail_by_image_id(1170)
29
- # self.assertTrue(thumbnail.startswith(b'/9j/4AAQSkZJRgABAQAAAQ'))
30
35
31
- # def test_bad_token(self):
32
- # bl = Biolucida()
33
- # bl.set_token('bad_token')
34
- # thumbnail = thumbnail_by_image_id(1170)
35
- # self.assertTrue(thumbnail.startswith(b'/9j/4AAQSkZJRgABAQAAAQ'))
36
-
37
-
38
- # if __name__ == '__main__':
39
- # unittest.main()
36
+ if __name__ == '__main__' :
37
+ unittest .main ()
0 commit comments