Skip to content
Open
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CONTRIBUTORS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Gistit contributors
===================

Hanish K H <hanish0019<at>gmail<dot>com>

18 changes: 18 additions & 0 deletions gistit.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,9 @@ def make_parser():
def main():
parser = make_parser()
args = parser.parse_args()
if args.command is None:
parser.print_help()
sys.exit(1)
Comment thread
millefalcon marked this conversation as resolved.
Outdated
command = args.func
sys.exit(command(args))

Expand Down Expand Up @@ -335,3 +338,18 @@ def test_token(self):

def test_create(self):
self.assertReadmeContainsOutput(['create', '-h'])

class SimpleRun(unittest.TestCase):
def setUp(self):
cmd_args = [sys.executable, 'gistit.py', '--help']
self.help_output_lines = subprocess.Popen(
cmd_args,
stdout=subprocess.PIPE).communicate()[0].decode('utf-8')

def test_no_args(self):
cmd_args = [sys.executable, 'gistit.py']
self.test_output_lines = subprocess.Popen(
cmd_args,
stdout=subprocess.PIPE).communicate()[0].decode('utf-8')
self.assertTrue(self.help_output_lines == self.test_output_lines)
Comment thread
millefalcon marked this conversation as resolved.
Outdated