예제 #1
0
 def test_pretty_str(self):
     """
     Test _pretty_str method of AttribDict.
     """
     # 1
     ad = AttribDict({'test1': 1, 'test2': 2})
     out = '           test1: 1\n           test2: 2'
     self.assertEqual(ad._pretty_str(), out)
     # 2
     ad = AttribDict({'test1': 1, 'test2': 2})
     out = '           test2: 2\n           test1: 1'
     self.assertEqual(ad._pretty_str(priorized_keys=['test2']), out)
     # 3
     ad = AttribDict({'test1': 1, 'test2': 2})
     out = ' test1: 1\n test2: 2'
     self.assertEqual(ad._pretty_str(min_label_length=6), out)
예제 #2
0
 def test_pretty_str(self):
     """
     Test _pretty_str method of AttribDict.
     """
     # 1
     ad = AttribDict({'test1': 1, 'test2': 2})
     out = '           test1: 1\n           test2: 2'
     self.assertEqual(ad._pretty_str(), out)
     # 2
     ad = AttribDict({'test1': 1, 'test2': 2})
     out = '           test2: 2\n           test1: 1'
     self.assertEqual(ad._pretty_str(priorized_keys=['test2']), out)
     # 3
     ad = AttribDict({'test1': 1, 'test2': 2})
     out = ' test1: 1\n test2: 2'
     self.assertEqual(ad._pretty_str(min_label_length=6), out)
예제 #3
0
 def test_pretty_str(self):
     """
     Test _pretty_str method of AttribDict.
     """
     # 1
     ad = AttribDict({'test1': 1, 'test2': 2})
     out = '           test1: 1\n           test2: 2'
     assert ad._pretty_str() == out
     # 2
     ad = AttribDict({'test1': 1, 'test2': 2})
     out = '           test2: 2\n           test1: 1'
     assert ad._pretty_str(priorized_keys=['test2']) == out
     # 3
     ad = AttribDict({'test1': 1, 'test2': 2})
     out = ' test1: 1\n test2: 2'
     assert ad._pretty_str(min_label_length=6) == out