From f7c7739a27e04aa414e2c2d7fd7b49042adf21ce Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Mar 28 2017 12:58:47 +0000 Subject: Add unit-test for running pagure-admin without any arguments --- diff --git a/tests/test_pagure_admin.py b/tests/test_pagure_admin.py index f3d09a1..8aeee34 100644 --- a/tests/test_pagure_admin.py +++ b/tests/test_pagure_admin.py @@ -53,6 +53,17 @@ def _get_ouput(cmd): class PagureAdminHelptests(tests.Modeltests): """ Tests for pagure-admin --help """ + def test_parse_arguments(self): + """ Test the parse_arguments function of pagure-admin. """ + cmd = ['python', PAGURE_ADMIN] + output = _get_ouput(cmd) + self.assertEqual(output[0], '') + self.assertEqual(output[1], '''usage: admin.py [-h] [--debug] + {refresh-gitolite,refresh-ssh,clear-hook-token,admin-token} + ... +admin.py: error: too few arguments +''') + def test_parse_arguments_help(self): """ Test the parse_arguments function of pagure-admin. """ cmd = ['python', PAGURE_ADMIN, '--help']