

def test_basic_usage(self):
    cmd = commands.Command()
    self.assertEqual('usage: foo', cmd.format_usage('foo').strip())
    cmd.add_argument('-h', '--help', action='store_true')
    self.assertEqual('usage: foo [-h]', cmd.format_usage('foo').strip())
    cmd.add_argument('bar')
    self.assertEqual('usage: foo [-h] bar', cmd.format_usage('foo').strip())

dataset/ETHPy150Open mopidy/mopidy/tests/test_commands.py UsageTest.test_basic_usage/original