Skip to content

Commit

Permalink
Merge pull request ABI-Software#19 from nih-sparc/test_bio
Browse files Browse the repository at this point in the history
uncommenting biolucida tests
  • Loading branch information
JeremyLecoeur authored Jul 7, 2020
2 parents 286bd84 + 2ae93ed commit 3878782
Showing 1 changed file with 24 additions and 26 deletions.
50 changes: 24 additions & 26 deletions tests/test_biolucida.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,36 +4,34 @@
from app.main import Biolucida


# class BiolucidaTestCase(unittest.TestCase):
class BiolucidaTestCase(unittest.TestCase):

# def test_authenticate(self):
# bl = Biolucida()
def test_authenticate(self):
bl = Biolucida()
authenticate_biolucida()
self.assertNotEqual('', bl.token())

# authenticate_biolucida()
def test_get_image_info(self):
image_info = image_info_by_image_id(1170)
self.assertEqual('success', image_info['status'])
self.assertEqual('115', image_info['collection_id'])

# self.assertNotEqual('', bl.token())
def test_get_thumbnail(self):
thumbnail = thumbnail_by_image_id(1170)
self.assertTrue(thumbnail.startswith(b'/9j/4AAQSkZJRgABAQAAAQ'))

# def test_get_image_info(self):
# image_info = image_info_by_image_id(1170)
# self.assertEqual('success', image_info['status'])
# self.assertEqual('115', image_info['collection_id'])
def test_old_token(self):
bl = Biolucida()
bl.set_token('a20f155e818fbfebbb03275f30f87697')
thumbnail = thumbnail_by_image_id(1170)
self.assertTrue(thumbnail.startswith(b'/9j/4AAQSkZJRgABAQAAAQ'))

# def test_get_thumbnail(self):
# thumbnail = thumbnail_by_image_id(1170)
# self.assertTrue(thumbnail.startswith(b'/9j/4AAQSkZJRgABAQAAAQ'))
def test_bad_token(self):
bl = Biolucida()
bl.set_token('bad_token')
thumbnail = thumbnail_by_image_id(1170)
self.assertTrue(thumbnail.startswith(b'/9j/4AAQSkZJRgABAQAAAQ'))

# def test_old_token(self):
# bl = Biolucida()
# bl.set_token('a20f155e818fbfebbb03275f30f87697')
# thumbnail = thumbnail_by_image_id(1170)
# self.assertTrue(thumbnail.startswith(b'/9j/4AAQSkZJRgABAQAAAQ'))

# def test_bad_token(self):
# bl = Biolucida()
# bl.set_token('bad_token')
# thumbnail = thumbnail_by_image_id(1170)
# self.assertTrue(thumbnail.startswith(b'/9j/4AAQSkZJRgABAQAAAQ'))


# if __name__ == '__main__':
# unittest.main()
if __name__ == '__main__':
unittest.main()

0 comments on commit 3878782

Please sign in to comment.