

@mock.patch('sys.argv')
def test_prog_name_default_and_override(self, argv_mock):
    argv_mock.__getitem__.return_value = '/usr/bin/foo'
    cmd = commands.Command()
    self.assertEqual('usage: foo', cmd.format_help().strip())
    self.assertEqual('usage: bar', argv_mock.format_help('bar').strip())

dataset/ETHPy150Open mopidy/mopidy/tests/test_commands.py HelpTest.test_prog_name_default_and_override/VarMisuse@59/94 `cmd`->`argv_mock`