예제 #1
0
 def test_dimesions(self):
   tag = Tag( Stroke((-1,-1,-1)), Stroke((1,1,1)) )
   self.assertEqual( tag.dimensions, (2,2) )
예제 #2
0
 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)) )
예제 #3
0
 def test_empty_tags_have_same_hash(self):
   t1 = Tag()
   t2 = Tag()
   self.assertEqual(hash(t1), hash(t2))
예제 #4
0
 def test_bounds(self):
   tag = Tag( Stroke((0,0,0)), Stroke((1,1,1)) )
   self.assertEqual( tag.bounds, ((0,0), (1,1)) )
예제 #5
0
 def test_duration(self):
   tag = Tag( Stroke((0,0,1)), Stroke((0,0,2)) )
   self.assertEqual(tag.duration, 3)
예제 #6
0
 def test_empty_tags_equal(self):
   t1 = Tag()
   t2 = Tag()
   self.assertEqual(t1, t2)
예제 #7
0
 def test_centroid(self):
   tag = Tag( Stroke((0,0,0)), Stroke((2,2,2)) )
   self.assertEqual(tag.centroid, (1,1))
예제 #8
0
 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 )
예제 #9
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 )
예제 #10
0
 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 )
예제 #11
0
 def setUp(self):
   self.empty_tag = Tag()