Пример #1
0
 def test_invert_mapping(self):
     mapping = dict(one=1, two=2, three=3, four=4)
     expected = {1: 'one', 2: 'two', 3: 'three', 4: 'four'}
     actual = Plot2D._invert_mapping(mapping)
     self.assertEqual(actual, expected)
Пример #2
0
 def test_invert_mapping(self):
     mapping = dict(one=1, two=2, three=3, four=4)
     expected = {1: 'one', 2: 'two', 3: 'three', 4: 'four'}
     actual = Plot2D._invert_mapping(mapping)
     self.assertEqual(actual, expected)
Пример #3
0
 def test_bad_mapping(self):
     mapping = dict(one=1, two=2, three=3, four=1)
     emsg = 'Cannot invert non 1-to-1 mapping'
     with self.assertRaisesRegexp(ValueError, emsg):
         Plot2D._invert_mapping(mapping)
Пример #4
0
 def test_bad_mapping(self):
     mapping = dict(one=1, two=2, three=3, four=1)
     emsg = 'Cannot invert non 1-to-1 mapping'
     with self.assertRaisesRegexp(ValueError, emsg):
         Plot2D._invert_mapping(mapping)