Exemplo n.º 1
0
 def test_StrCategoryFormatter(self, ax, ydata):
     unit = cat.UnitData(ydata)
     labels = cat.StrCategoryFormatter(unit._mapping)
     for i, d in enumerate(ydata):
         assert labels(i, i) == d
         assert labels(i, None) == d
Exemplo n.º 2
0
 def test_StrCategoryFormatter(self):
     seq = ["hello", "world", "hi"]
     labels = cat.StrCategoryFormatter(seq)
     assert labels('a', 1) == "world"
Exemplo n.º 3
0
 def test_StrCategoryFormatterUnicode(self):
     seq = ["Здравствуйте", "привет"]
     labels = cat.StrCategoryFormatter(seq)
     assert labels('a', 1) == "привет"
Exemplo n.º 4
0
 def test_StrCategoryFormatter(self):
     labels = cat.StrCategoryFormatter(self.seq)
     self.assertEqual(labels('a', 1), "world")