Пример #1
0
 def test_no_acronym(self):
     default_config = {
       "automatic": {
         "Auto-Indent": False,
         "line numbers": False
       }
     }
     with self.assertRaisesRegex(Exception, '(?i)config'):
         get_auto_setting_acronym(default_config)
Пример #2
0
 def test_default(self):
     default_config = {
       "automatic": {
         "Auto-Indent": False,
         "Line Numbers": False,
         "open in New Window": False,
         "Vertical Scrollbar": "on",
         "Animate Terminal Output": False,
         "Terminal Animation Interval": 5,
         "max Page Width": 1000,
         "Show WordCount in titlebar": False
       }
     }
     correct_result = {
         "ai": "Auto-Indent",
         "ln": "Line Numbers",
         "nw": "open in New Window",
         "vs": "Vertical Scrollbar",
         "ato": "Animate Terminal Output",
         "tai": "Terminal Animation Interval",
         "pw": "max Page Width",
         "swc": "Show WordCount in titlebar"
     }
     result = get_auto_setting_acronym(default_config)
     self.assertEqual(result, correct_result)
Пример #3
0
 def test_empty_config(self):
     result = get_auto_setting_acronym({'automatic':{}})
     self.assertEqual(result, {})