Exemplo n.º 1
0
 def test_complete_match_ndoverlay(self):
     spec = ('Points', 'Points', '', 1)
     specs = [(0, ('Points', 'Points', '', 0)), (1, ('Points', 'Points', '', 1)),
              (2, ('Points', 'Points', '', 2))]
     self.assertEqual(closest_match(spec, specs), 1)
     spec = ('Points', 'Points', '', 2)
     self.assertEqual(closest_match(spec, specs), 2)
Exemplo n.º 2
0
 def test_complete_match_ndoverlay(self):
     spec = ('Points', 'Points', '', 1)
     specs = [(0, ('Points', 'Points', '', 0)), (1, ('Points', 'Points', '', 1)),
              (2, ('Points', 'Points', '', 2))]
     self.assertEqual(closest_match(spec, specs), 1)
     spec = ('Points', 'Points', '', 2)
     self.assertEqual(closest_match(spec, specs), 2)
Exemplo n.º 3
0
 def test_no_match_ndoverlay(self):
     specs = [(0, ('Points', 'Points', '', 0)), (1, ('Points', 'Points', '', 1)),
              (2, ('Points', 'Points', '', 2))]
     spec = ('Scatter', 'Points', '', 5)
     self.assertEqual(closest_match(spec, specs), None)
     spec = ('Scatter', 'Bar', 'Foo', 5)
     self.assertEqual(closest_match(spec, specs), None)
     spec = ('Scatter', 'Foo', 'Bar', 5)
     self.assertEqual(closest_match(spec, specs), None)
Exemplo n.º 4
0
 def test_partial_match_ndoverlay(self):
     spec = ('Points', 'Points', '', 5)
     specs = [(0, ('Points', 'Points', '', 0)), (1, ('Points', 'Points', '', 1)),
              (2, ('Points', 'Points', '', 2))]
     self.assertEqual(closest_match(spec, specs), 2)
     spec = ('Points', 'Points', 'Bar', 5)
     self.assertEqual(closest_match(spec, specs), 0)
     spec = ('Points', 'Foo', 'Bar', 5)
     self.assertEqual(closest_match(spec, specs), 0)
Exemplo n.º 5
0
 def test_no_match_ndoverlay(self):
     specs = [(0, ('Points', 'Points', '', 0)), (1, ('Points', 'Points', '', 1)),
              (2, ('Points', 'Points', '', 2))]
     spec = ('Scatter', 'Points', '', 5)
     self.assertEqual(closest_match(spec, specs), None)
     spec = ('Scatter', 'Bar', 'Foo', 5)
     self.assertEqual(closest_match(spec, specs), None)
     spec = ('Scatter', 'Foo', 'Bar', 5)
     self.assertEqual(closest_match(spec, specs), None)
Exemplo n.º 6
0
 def test_partial_match_ndoverlay(self):
     spec = ('Points', 'Points', '', 5)
     specs = [(0, ('Points', 'Points', '', 0)), (1, ('Points', 'Points', '', 1)),
              (2, ('Points', 'Points', '', 2))]
     self.assertEqual(closest_match(spec, specs), 2)
     spec = ('Points', 'Points', 'Bar', 5)
     self.assertEqual(closest_match(spec, specs), 0)
     spec = ('Points', 'Foo', 'Bar', 5)
     self.assertEqual(closest_match(spec, specs), 0)
Exemplo n.º 7
0
 def test_no_match_overlay(self):
     specs = [(0, ('Curve', 'Curve', 'I')), (1, ('Points', 'Points', 'I'))]
     spec = ('Scatter', 'Points', 'II')
     self.assertEqual(closest_match(spec, specs), None)
     spec = ('Path', 'Curve', 'III')
     self.assertEqual(closest_match(spec, specs), None)
Exemplo n.º 8
0
 def test_partial_mismatch_overlay(self):
     specs = [(0, ('Curve', 'Curve', 'I')), (1, ('Points', 'Points', 'I'))]
     spec = ('Curve', 'Foo', 'II')
     self.assertEqual(closest_match(spec, specs), 0)
     spec = ('Points', 'Bar', 'III')
     self.assertEqual(closest_match(spec, specs), 1)
Exemplo n.º 9
0
 def test_complete_match_overlay(self):
     specs = [(0, ('Curve', 'Curve', 'I')), (1, ('Points', 'Points', 'I'))]
     spec = ('Curve', 'Curve', 'I')
     self.assertEqual(closest_match(spec, specs), 0)
     spec = ('Points', 'Curve', 'I')
     self.assertEqual(closest_match(spec, specs), 1)
Exemplo n.º 10
0
 def test_no_match_overlay(self):
     specs = [(0, ('Curve', 'Curve', 'I')), (1, ('Points', 'Points', 'I'))]
     spec = ('Scatter', 'Points', 'II')
     self.assertEqual(closest_match(spec, specs), None)
     spec = ('Path', 'Curve', 'III')
     self.assertEqual(closest_match(spec, specs), None)
Exemplo n.º 11
0
 def test_partial_mismatch_overlay(self):
     specs = [(0, ('Curve', 'Curve', 'I')), (1, ('Points', 'Points', 'I'))]
     spec = ('Curve', 'Foo', 'II')
     self.assertEqual(closest_match(spec, specs), 0)
     spec = ('Points', 'Bar', 'III')
     self.assertEqual(closest_match(spec, specs), 1)
Exemplo n.º 12
0
 def test_complete_match_overlay(self):
     specs = [(0, ('Curve', 'Curve', 'I')), (1, ('Points', 'Points', 'I'))]
     spec = ('Curve', 'Curve', 'I')
     self.assertEqual(closest_match(spec, specs), 0)
     spec = ('Points', 'Curve', 'I')
     self.assertEqual(closest_match(spec, specs), 1)