def test_shaper_create(self): ar_downsample._loadAR() glyphspec = {'type': 'Square', 'size': {'value': 3}, 'radius': {'value': 3}} self.assertIsInstance(ar_downsample._shaper(glyphspec, False), glyphset.ToRect) self.assertIsInstance(ar_downsample._shaper(glyphspec, True), glyphset.ToPoint) self.assertIsInstance(ar_downsample._shaper(glyphspec, True), glyphset.ToPoint)
def test_shaper_create(self): ar_downsample._loadAR() glyphspec = {'type': 'Square', 'size': {'value': 3}, 'radius': {'value': 3}} self.assertIsInstance(ar_downsample._shaper(glyphspec, False), glyphset.ToRect) self.assertIsInstance(ar_downsample._shaper(glyphspec, True), glyphset.ToPoint) self.assertIsInstance(ar_downsample._shaper(glyphspec, True), glyphset.ToPoint)
def test_shaper_fail(self): ar_downsample._loadAR() with self.assertRaises(ValueError): ar_downsample._shaper({ 'type': 'blah', 'size': { 'value': 3 } }, False)
def test_shaper_fail(self): ar_downsample._loadAR() with self.assertRaises(ValueError): ar_downsample._shaper("circle", 3, False) ar_downsample._shaper("blah", 3, False)
def test_shaper_create(self): ar_downsample._loadAR() self.assertIsInstance(ar_downsample._shaper("square", 3, False), glyphset.ToRect) self.assertIsInstance(ar_downsample._shaper("square", 3, True), glyphset.ToPoint) self.assertIsInstance(ar_downsample._shaper("circle", 3, True), glyphset.ToPoint)
def test_shaper_fail(self): ar_downsample._loadAR() with self.assertRaises(ValueError): ar_downsample._shaper({'type': 'blah', 'size': {'value': 3}}, False)