

def test_gallery_random(self):
    argv = ['gallery', 'random']
    _cli = self.cli(argv)
    parser_args = _cli.parser.parse_args(argv)
    parser_args.assertParser(_cli, parser_args, argv)
    self.assertTrue(_cli.client.gallery_random.called)
    self.assertEqual(parser_args.page, 0)
    self.assertEqual(parser_args.output_file, None)
    argv.extend(['--page', '12', '--output-file', 'dummy.json'])
    _cli = self.cli(argv)
    parser_args = _cli.parser.parse_args(argv)
    self.assertTrue(_cli.client.gallery_random.called)
    self.assertEqual(parser_args.page, int(argv[3]))
    self.assertEqual(parser_args.output_file, argv[5])
    self.assertTrue(isinstance(parser_args.page, int))

dataset/ETHPy150Open ueg1990/imgur-cli/tests/test_cli.py TestImgurCli.test_gallery_random/VarMisuse@38/52 `self`->`parser_args`