예제 #1
0
 def testClassFishScript(self):
     script = completion.Script('', tc.MixedDefaults, shell='fish')
     self.assertIn('ten', script)
     self.assertIn('sum', script)
     self.assertIn('identity', script)
     self.assertIn('alpha', script)
     self.assertIn('beta', script)
예제 #2
0
 def testDeepDictFishScript(self):
     deepdict = {'level1': {'level2': {'level3': {'level4': {}}}}}
     script = completion.Script('deepdict', deepdict, shell='fish')
     self.assertIn('level1', script)
     self.assertIn('level2', script)
     self.assertIn('level3', script)
     self.assertNotIn('level4', script)  # The default depth is 3.
예제 #3
0
 def testClassFishScript(self):
     script = completion.Script("", tc.MixedDefaults, shell="fish")
     self.assertIn("ten", script)
     self.assertIn("sum", script)
     self.assertIn("identity", script)
     self.assertIn("alpha", script)
     self.assertIn("beta", script)
예제 #4
0
 def testClassScript(self):
     script = completion.Script('', tc.MixedDefaults)
     self.assertIn('ten', script)
     self.assertIn('sum', script)
     self.assertIn('identity', script)
     self.assertIn('--alpha', script)
     self.assertIn('--beta', script)
예제 #5
0
 def testDeepDictFishScript(self):
     deepdict = {"level1": {"level2": {"level3": {"level4": {}}}}}
     script = completion.Script("deepdict", deepdict, shell="fish")
     self.assertIn("level1", script)
     self.assertIn("level2", script)
     self.assertIn("level3", script)
     self.assertNotIn("level4", script)  # The default depth is 3.
예제 #6
0
 def testClassScript(self):
     script = completion.Script("", tc.MixedDefaults)
     self.assertIn("ten", script)
     self.assertIn("sum", script)
     self.assertIn("identity", script)
     self.assertIn("--alpha", script)
     self.assertIn("--beta", script)
예제 #7
0
파일: core.py 프로젝트: yongtin/python-fire
def CompletionScript(name, component):
    """Returns the text of the Bash completion script for a Fire CLI."""
    return completion.Script(name, component)
예제 #8
0
def CompletionScript(name, component, shell):
    """Returns the text of the completion script for a Fire CLI."""
    return completion.Script(name, component, shell=shell)
예제 #9
0
 def testFnFishScript(self):
     script = completion.Script('identity', tc.identity, shell='fish')
     self.assertIn('arg1', script)
     self.assertIn('arg2', script)
     self.assertIn('arg3', script)
     self.assertIn('arg4', script)
예제 #10
0
 def testFnScript(self):
     script = completion.Script('identity', tc.identity)
     self.assertIn('--arg1', script)
     self.assertIn('--arg2', script)
     self.assertIn('--arg3', script)
     self.assertIn('--arg4', script)
예제 #11
0
 def testFnFishScript(self):
     script = completion.Script("identity", tc.identity, shell="fish")
     self.assertIn("arg1", script)
     self.assertIn("arg2", script)
     self.assertIn("arg3", script)
     self.assertIn("arg4", script)
예제 #12
0
 def testFnScript(self):
     script = completion.Script("identity", tc.identity)
     self.assertIn("--arg1", script)
     self.assertIn("--arg2", script)
     self.assertIn("--arg3", script)
     self.assertIn("--arg4", script)