Skip to content

Commit

Permalink
Migrate more tests from helputils_test.py to helptext_test.py
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 244461697
Change-Id: I96d77f4cce436b017279ef203f6c4530d1e2f93b
  • Loading branch information
joejoevictor authored and copybara-github committed Apr 20, 2019
1 parent 1e2053b commit 5972332
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions fire/helptext_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,31 @@ def testHelpTextFunctionWithDefaults(self):
self.assertIn('FLAGS\n --count', help_screen)
self.assertNotIn('NOTES', help_screen)

def testHelpTextFunctionWithBuiltin(self):
component = 'test'.upper
info = inspectutils.Info(component)
help_screen = helptext.HelpText(
component=component,
info=info,
trace=trace.FireTrace(component, 'upper'))
self.assertIn('NAME\n upper', help_screen)
self.assertIn('SYNOPSIS\n upper', help_screen)
# We don't check description content here since the content is python
# version dependent.
self.assertIn('DESCRIPTION\n', help_screen)
self.assertNotIn('NOTES', help_screen)

def testHelpTextFunctionIntType(self):
component = int
info = inspectutils.Info(component)
help_screen = helptext.HelpText(
component=component, info=info, trace=trace.FireTrace(component, 'int'))
self.assertIn('NAME\n int', help_screen)
self.assertIn('SYNOPSIS\n int', help_screen)
# We don't check description content here since the content is python
# version dependent.
self.assertIn('DESCRIPTION\n', help_screen)

def testHelpScreen(self):
component = tc.ClassWithDocstring()
t = trace.FireTrace(component, name='ClassWithDocstring')
Expand Down

0 comments on commit 5972332

Please sign in to comment.