• Home
  • Raw
  • Download

Lines Matching refs:cfg

57 def _LooksLikeChromiumStyle(cfg):  argument
58 return (cfg['INDENT_WIDTH'] == 2 and
59 cfg['BLANK_LINE_BEFORE_NESTED_CLASS_OR_DEF'])
62 def _LooksLikeGoogleStyle(cfg): argument
63 return (cfg['INDENT_WIDTH'] == 4 and
64 cfg['BLANK_LINE_BEFORE_NESTED_CLASS_OR_DEF'])
67 def _LooksLikePEP8Style(cfg): argument
68 return (cfg['INDENT_WIDTH'] == 4 and
69 not cfg['BLANK_LINE_BEFORE_NESTED_CLASS_OR_DEF'])
72 def _LooksLikeFacebookStyle(cfg): argument
73 return cfg['INDENT_WIDTH'] == 4 and cfg['DEDENT_CLOSING_BRACKETS']
84 cfg = style.CreateStyleFromConfig(None)
85 self.assertTrue(_LooksLikePEP8Style(cfg))
89 cfg = style.CreateStyleFromConfig(pep8_name)
90 self.assertTrue(_LooksLikePEP8Style(cfg))
94 cfg = style.CreateStyleFromConfig(google_name)
95 self.assertTrue(_LooksLikeGoogleStyle(cfg))
99 cfg = style.CreateStyleFromConfig(chromium_name)
100 self.assertTrue(_LooksLikeChromiumStyle(cfg))
104 cfg = style.CreateStyleFromConfig(fb_name)
105 self.assertTrue(_LooksLikeFacebookStyle(cfg))
120 cfg = textwrap.dedent(u'''\
124 with utils.TempFileContents(self.test_tmpdir, cfg) as filepath:
125 cfg = style.CreateStyleFromConfig(filepath)
126 self.assertTrue(_LooksLikePEP8Style(cfg))
127 self.assertEqual(cfg['CONTINUATION_INDENT_WIDTH'], 20)
130 cfg = textwrap.dedent(u'''\
135 with utils.TempFileContents(self.test_tmpdir, cfg) as filepath:
136 cfg = style.CreateStyleFromConfig(filepath)
137 self.assertTrue(_LooksLikePEP8Style(cfg))
138 self.assertEqual(cfg['CONTINUATION_INDENT_WIDTH'], 40)
141 cfg = textwrap.dedent(u'''\
146 with utils.TempFileContents(self.test_tmpdir, cfg) as filepath:
147 cfg = style.CreateStyleFromConfig(filepath)
148 self.assertTrue(_LooksLikeChromiumStyle(cfg))
149 self.assertEqual(cfg['CONTINUATION_INDENT_WIDTH'], 30)
152 cfg = textwrap.dedent(u'''\
157 with utils.TempFileContents(self.test_tmpdir, cfg) as filepath:
158 cfg = style.CreateStyleFromConfig(filepath)
159 self.assertTrue(_LooksLikeGoogleStyle(cfg))
160 self.assertEqual(cfg['CONTINUATION_INDENT_WIDTH'], 20)
163 cfg = textwrap.dedent(u'''\
168 with utils.TempFileContents(self.test_tmpdir, cfg) as filepath:
169 cfg = style.CreateStyleFromConfig(filepath)
170 self.assertTrue(_LooksLikeFacebookStyle(cfg))
171 self.assertEqual(cfg['CONTINUATION_INDENT_WIDTH'], 20)
174 cfg = textwrap.dedent(u'''\
180 with utils.TempFileContents(self.test_tmpdir, cfg) as filepath:
181 cfg = style.CreateStyleFromConfig(filepath)
182 self.assertTrue(_LooksLikeChromiumStyle(cfg))
183 self.assertEqual(cfg['SPLIT_BEFORE_NAMED_ASSIGNS'], False)
184 self.assertEqual(cfg['SPLIT_BEFORE_LOGICAL_OPERATOR'], True)
187 cfg = textwrap.dedent(u'''\
192 with utils.TempFileContents(self.test_tmpdir, cfg) as filepath:
193 cfg = style.CreateStyleFromConfig(filepath)
194 self.assertTrue(_LooksLikeChromiumStyle(cfg))
195 self.assertEqual(cfg['I18N_FUNCTION_CALL'], ['N_', 'V_', 'T_'])
203 cfg = textwrap.dedent(u'''\
207 with utils.TempFileContents(self.test_tmpdir, cfg) as filepath:
213 cfg = textwrap.dedent(u'''\
218 with utils.TempFileContents(self.test_tmpdir, cfg) as filepath:
236 cfg = style.CreateStyleFromConfig(config_dict)
237 self.assertTrue(_LooksLikeChromiumStyle(cfg))
238 self.assertEqual(cfg['INDENT_WIDTH'], 2)
256 cfg = style.CreateStyleFromConfig(
260 self.assertTrue(_LooksLikeChromiumStyle(cfg))
261 self.assertEqual(cfg['INDENT_WIDTH'], 2)
264 cfg = style.CreateStyleFromConfig(
268 self.assertTrue(_LooksLikeChromiumStyle(cfg))
269 self.assertEqual(cfg['INDENT_WIDTH'], 2)
272 cfg = style.CreateStyleFromConfig(u'{}')
273 self.assertIsInstance(cfg, dict)
276 cfg = style.CreateStyleFromConfig('{}')
277 self.assertIsInstance(cfg, dict)