def test_gen(self):
        gen_a = mock.MagicMock()
        cli = Sqla(orm.sessionmaker(), MetaData(), generators={'a': gen_a})
        try:
            cli.command_gen()
        except __HOLE__:
            pass
        gen_a.assert_not_called()

        gen_a.reset_mock()
        cli.command_gen('a')
        gen_a.assert_called_once_with(cli.session, 0)

        gen_a.reset_mock()
        cli.command_gen('a:123')
        gen_a.assert_called_once_with(cli.session, 123)
dataset/ETHPy150Open SmartTeleMax/iktomi/tests/cli/sqla.py/SqlaTests.test_gen