MCPcopy Create free account
hub / github.com/apache/arrow / CommandInput

Class CommandInput

dev/merge_arrow_pr.py:358–380  ·  view source on GitHub ↗

Interface to input(...) to enable unit test mocks to be created

Source from the content-addressed store, hash-verified

356
357
358class CommandInput(object):
359 """
360 Interface to input(...) to enable unit test mocks to be created
361 """
362
363 def fail(self, msg):
364 raise Exception(msg)
365
366 def prompt(self, prompt):
367 return input(prompt)
368
369 def getpass(self, prompt):
370 return getpass.getpass(prompt)
371
372 def continue_maybe(self, prompt):
373 while True:
374 result = input("\n%s (y/n): " % prompt)
375 if result.lower() == "y":
376 return
377 elif result.lower() == "n":
378 self.fail("Okay, exiting")
379 else:
380 prompt = "Please input 'y' or 'n'"
381
382
383class PullRequest(object):

Callers 1

cliFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected