Permalink
Browse files

tests: Test reading an associated image

  • Loading branch information...
1 parent 641e78a commit 54a09d1a1ceb15836fc3e046fb491581431f9c01 @bgilbert bgilbert committed May 25, 2016
Showing with 18 additions and 9 deletions.
  1. +1 −1 MANIFEST.in
  2. BIN tests/small.svs
  3. +17 −8 tests/test_openslide.py
View
@@ -1,4 +1,4 @@
include *.txt
recursive-include doc *.py *.rst
recursive-include examples *.html *.js *.png *.py
-recursive-include tests *.png *.py *.tiff
+recursive-include tests *.png *.py *.svs *.tiff
View
Binary file not shown.
View
@@ -93,14 +93,6 @@ def test_properties(self):
self.assertEqual(len([v for v in self.osr.properties]),
len(self.osr.properties))
- def test_associated_images(self):
- # XXX test an associated image
- self.assertRaises(KeyError,
- lambda: self.osr.associated_images['__missing'])
- # test __len__ and __iter__
- self.assertEqual(len([v for v in self.osr.associated_images]),
- len(self.osr.associated_images))
-
def test_read_region(self):
self.assertEqual(self.osr.read_region((-10, -10), 1, (400, 400)).size,
(400, 400))
@@ -119,3 +111,20 @@ def test_read_region_bad_size(self):
def test_thumbnail(self):
self.assertEqual(self.osr.get_thumbnail((100, 100)).size, (100, 83))
+
+
+class TestAperioSlide(unittest.TestCase):
+ def setUp(self):
+ self.osr = OpenSlide(file_path('small.svs'))
+
+ def tearDown(self):
+ self.osr.close()
+
+ def test_associated_images(self):
+ self.assertEqual(self.osr.associated_images['thumbnail'].size,
+ (16, 16))
+ self.assertRaises(KeyError,
+ lambda: self.osr.associated_images['__missing'])
+ # test __len__ and __iter__
+ self.assertEqual(len([v for v in self.osr.associated_images]),
+ len(self.osr.associated_images))

0 comments on commit 54a09d1

Please sign in to comment.