

def test_gallery(self):
    argv = ['gallery', 'items']
    _cli = self.cli(argv)
    parser_args = expected_args.parser.parse_args(argv)
    self.assertParser(_cli, parser_args, argv)
    self.assertTrue(_cli.client.gallery.called)
    expected_args = {
        'section': 'hot',
        'sort': 'viral',
        'page': 0,
        'window': 'day',
        'show_viral': False,
        'output_file': None,
    }
    self.assertTrue(all(((getattr(parser_args, key) == value) for (key, value) in expected_args.items())))
    argv.extend(['--show-viral'])
    _cli = self.cli(argv)
    parser_args = _cli.parser.parse_args(argv)
    expected_args['show_viral'] = True
    self.assertTrue(all(((getattr(parser_args, key) == value) for (key, value) in expected_args.items())))

dataset/ETHPy150Open ueg1990/imgur-cli/tests/test_cli.py TestImgurCli.test_gallery/VarMisuse@29/40 `_cli`->`expected_args`