Skip to content

Commit 9629074

Browse files
dbiebercopybara-github
authored andcommitted
Triple double-quotes, not triple single-quotes and linter error for callable_with_keyword_argument
PiperOrigin-RevId: 260049158 Change-Id: I2b0cd024f2f700d73a60d972a0365c6674112c0f
1 parent 86e2c35 commit 9629074

File tree

2 files changed

+21
-21
lines changed

2 files changed

+21
-21
lines changed

fire/helptext_test.py

+20-20
Original file line numberDiff line numberDiff line change
@@ -288,12 +288,12 @@ def testUsageOutput(self):
288288
component = tc.NoDefaults()
289289
t = trace.FireTrace(component, name='NoDefaults')
290290
usage_output = helptext.UsageText(component, trace=t, verbose=False)
291-
expected_output = '''
291+
expected_output = """
292292
Usage: NoDefaults <command>
293293
available commands: double | triple
294294
295295
For detailed information on this command, run:
296-
NoDefaults --help'''
296+
NoDefaults --help"""
297297

298298
self.assertEqual(
299299
usage_output,
@@ -303,12 +303,12 @@ def testUsageOutputVerbose(self):
303303
component = tc.NoDefaults()
304304
t = trace.FireTrace(component, name='NoDefaults')
305305
usage_output = helptext.UsageText(component, trace=t, verbose=True)
306-
expected_output = '''
306+
expected_output = """
307307
Usage: NoDefaults <command>
308308
available commands: double | triple
309309
310310
For detailed information on this command, run:
311-
NoDefaults --help'''
311+
NoDefaults --help"""
312312
self.assertEqual(
313313
usage_output,
314314
textwrap.dedent(expected_output).lstrip('\n'))
@@ -318,11 +318,11 @@ def testUsageOutputMethod(self):
318318
t = trace.FireTrace(component, name='NoDefaults')
319319
t.AddAccessedProperty(component, 'double', ['double'], None, None)
320320
usage_output = helptext.UsageText(component, trace=t, verbose=False)
321-
expected_output = '''
321+
expected_output = """
322322
Usage: NoDefaults double COUNT
323323
324324
For detailed information on this command, run:
325-
NoDefaults double --help'''
325+
NoDefaults double --help"""
326326
self.assertEqual(
327327
usage_output,
328328
textwrap.dedent(expected_output).lstrip('\n'))
@@ -331,12 +331,12 @@ def testUsageOutputFunctionWithHelp(self):
331331
component = tc.function_with_help
332332
t = trace.FireTrace(component, name='function_with_help')
333333
usage_output = helptext.UsageText(component, trace=t, verbose=False)
334-
expected_output = '''
334+
expected_output = """
335335
Usage: function_with_help <flags>
336336
optional flags: --help
337337
338338
For detailed information on this command, run:
339-
function_with_help -- --help'''
339+
function_with_help -- --help"""
340340
self.assertEqual(
341341
usage_output,
342342
textwrap.dedent(expected_output).lstrip('\n'))
@@ -345,12 +345,12 @@ def testUsageOutputFunctionWithDocstring(self):
345345
component = tc.multiplier_with_docstring
346346
t = trace.FireTrace(component, name='multiplier_with_docstring')
347347
usage_output = helptext.UsageText(component, trace=t, verbose=False)
348-
expected_output = '''
348+
expected_output = """
349349
Usage: multiplier_with_docstring NUM <flags>
350350
optional flags: --rate
351351
352352
For detailed information on this command, run:
353-
multiplier_with_docstring --help'''
353+
multiplier_with_docstring --help"""
354354
self.assertEqual(
355355
textwrap.dedent(expected_output).lstrip('\n'),
356356
usage_output)
@@ -361,13 +361,13 @@ def testUsageOutputCallable(self):
361361
t = trace.FireTrace(component, name='CallableWithKeywordArgument',
362362
separator='@')
363363
usage_output = helptext.UsageText(component, trace=t, verbose=False)
364-
expected_output = '''
364+
expected_output = """
365365
Usage: CallableWithKeywordArgument <command> | <flags>
366366
available commands: print_msg
367367
flags are accepted
368368
369369
For detailed information on this command, run:
370-
CallableWithKeywordArgument -- --help'''
370+
CallableWithKeywordArgument -- --help"""
371371
self.assertEqual(
372372
textwrap.dedent(expected_output).lstrip('\n'),
373373
usage_output)
@@ -376,11 +376,11 @@ def testUsageOutputConstructorWithParameter(self):
376376
component = tc.InstanceVars
377377
t = trace.FireTrace(component, name='InstanceVars')
378378
usage_output = helptext.UsageText(component, trace=t, verbose=False)
379-
expected_output = '''
379+
expected_output = """
380380
Usage: InstanceVars --arg1=ARG1 --arg2=ARG2
381381
382382
For detailed information on this command, run:
383-
InstanceVars --help'''
383+
InstanceVars --help"""
384384
self.assertEqual(
385385
textwrap.dedent(expected_output).lstrip('\n'),
386386
usage_output)
@@ -389,12 +389,12 @@ def testUsageOutputConstructorWithParameterVerbose(self):
389389
component = tc.InstanceVars
390390
t = trace.FireTrace(component, name='InstanceVars')
391391
usage_output = helptext.UsageText(component, trace=t, verbose=True)
392-
expected_output = '''
392+
expected_output = """
393393
Usage: InstanceVars <command> | --arg1=ARG1 --arg2=ARG2
394394
available commands: run
395395
396396
For detailed information on this command, run:
397-
InstanceVars --help'''
397+
InstanceVars --help"""
398398
self.assertEqual(
399399
textwrap.dedent(expected_output).lstrip('\n'),
400400
usage_output)
@@ -403,11 +403,11 @@ def testUsageOutputEmptyDict(self):
403403
component = {}
404404
t = trace.FireTrace(component, name='EmptyDict')
405405
usage_output = helptext.UsageText(component, trace=t, verbose=True)
406-
expected_output = '''
406+
expected_output = """
407407
Usage: EmptyDict
408408
409409
For detailed information on this command, run:
410-
EmptyDict --help'''
410+
EmptyDict --help"""
411411
self.assertEqual(
412412
textwrap.dedent(expected_output).lstrip('\n'),
413413
usage_output)
@@ -416,11 +416,11 @@ def testUsageOutputNone(self):
416416
component = None
417417
t = trace.FireTrace(component, name='None')
418418
usage_output = helptext.UsageText(component, trace=t, verbose=True)
419-
expected_output = '''
419+
expected_output = """
420420
Usage: None
421421
422422
For detailed information on this command, run:
423-
None --help'''
423+
None --help"""
424424
self.assertEqual(
425425
textwrap.dedent(expected_output).lstrip('\n'),
426426
usage_output)

fire/test_components.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,7 @@ def print_msg(self, msg):
336336
print(msg)
337337

338338

339-
callable_with_keyword_argument = CallableWithKeywordArgument()
339+
CALLABLE_WITH_KEYWORD_ARGUMENT = CallableWithKeywordArgument()
340340

341341

342342
class ClassWithDocstring(object):

0 commit comments

Comments
 (0)