def test_dimesions(self): tag = Tag( Stroke((-1,-1,-1)), Stroke((1,1,1)) ) self.assertEqual( tag.dimensions, (2,2) )
def test_flattened_stroke(self): tag = Tag( Stroke((0,0,0)), Stroke((1,1,1)) ) self.assertEqual( tag.flattened_stroke(), Stroke((0,0,0), (1,1,1)) )
def test_empty_tags_have_same_hash(self): t1 = Tag() t2 = Tag() self.assertEqual(hash(t1), hash(t2))
def test_bounds(self): tag = Tag( Stroke((0,0,0)), Stroke((1,1,1)) ) self.assertEqual( tag.bounds, ((0,0), (1,1)) )
def test_duration(self): tag = Tag( Stroke((0,0,1)), Stroke((0,0,2)) ) self.assertEqual(tag.duration, 3)
def test_empty_tags_equal(self): t1 = Tag() t2 = Tag() self.assertEqual(t1, t2)
def test_centroid(self): tag = Tag( Stroke((0,0,0)), Stroke((2,2,2)) ) self.assertEqual(tag.centroid, (1,1))
def test_std_distance_from_centroid(self): tag = Tag( Stroke((0,0,0)), Stroke((0,1,0)) ) self.assertEqual( tag.std_distance_from_centroid, 0 )
def test_mean_distance_from_centroid(self): tag = Tag( Stroke((0,-1,0)), Stroke((0,3,0))) self.assertEqual( tag.mean_distance_from_centroid, 2 )
def test_equal_mean_distance_from_centroid(self): tag = Tag( Stroke((-1,0,0)), Stroke((1,0,0))) self.assertEqual( tag.mean_distance_from_centroid, 1 )
def setUp(self): self.empty_tag = Tag()