def setUp(self): # arguments and keywords self.anchor = (0, 0) self.square = ROISelector.Square(self.anchor, 1) # # verbosity self.v = {'verbose': 1} print("") print(self.separator) print(self.shortDescription())
def test_Square(self): """ # ROISelector.Square """ # with scalar dv print(">>> {}, {}".format(self.anchor, 1)) s = ROISelector.Square(self.anchor, 1, **self.v) self.assertIsInstance(s, ROISelector.Square) self.assertEqual(s, self.square) self.assertEqual(s.N, 4) self.assertEqual(s.area, 1) # with corner print(">>> {}, {}".format(self.anchor, {'corner': (1, 2)})) s = ROISelector.Square(self.anchor, corner=(1, 2), **self.v) self.assertIsInstance(s, ROISelector.Square) self.assertNotEqual(s, self.square) self.assertEqual(s.N, 4) self.assertEqual(s.area, 4) # no second input print(">>> {}".format(self.anchor)) s = ROISelector.Square(self.anchor, **self.v) self.assertIsInstance(s, ROISelector.Square) self.assertNotEqual(s, self.square) self.assertEqual(s.N, 4) self.assertEqual(s.area, 0)