예제 #1
0
 def _main_test_helper(self, argv, func_name, exp_args=(), exp_kwargs={}):
     with mock.patch.object(sys, 'argv', argv), mock.patch.object(
             cli, 'run_sanity_checks'):
         cli.main()
         self.do_alembic_cmd.assert_has_calls(
             [mock.call(mock.ANY, func_name, *exp_args, **exp_kwargs)]
         )
예제 #2
0
 def _main_test_helper(self, argv, func_name, exp_args=(), exp_kwargs=[{}]):
     with mock.patch.object(sys, 'argv', argv), mock.patch.object(
             cli, 'run_sanity_checks'):
         cli.main()
         self.do_alembic_cmd.assert_has_calls([
             mock.call(mock.ANY, func_name, *exp_args, **kwargs)
             for kwargs in exp_kwargs
         ])
예제 #3
0
    def _main_test_helper(self, argv, func_name, exp_kwargs=[{}]):
        with mock.patch.object(sys, 'argv', argv),\
            mock.patch.object(cli, 'run_sanity_checks'),\
            mock.patch.object(cli, 'validate_labels'):

            cli.main()
            self.do_alembic_cmd.assert_has_calls(
                [mock.call(mock.ANY, func_name, **kwargs)
                 for kwargs in exp_kwargs]
            )
예제 #4
0
    def _main_test_helper(self, argv, func_name, exp_kwargs=[{}]):
        with mock.patch.object(sys, 'argv', argv),\
            mock.patch.object(cli, 'run_sanity_checks'),\
            mock.patch.object(cli, 'validate_revisions'),\
            mock.patch.object(cli, '_use_separate_migration_branches'):

            cli.main()
            self.do_alembic_cmd.assert_has_calls(
                [mock.call(mock.ANY, func_name, **kwargs)
                 for kwargs in exp_kwargs]
            )
예제 #5
0
    def _main_test_helper(self, argv, func_name, exp_kwargs=[{}]):
        with mock.patch.object(sys, 'argv', argv),\
                mock.patch.object(cli, 'run_sanity_checks'),\
                mock.patch.object(cli, 'validate_revisions'):

            cli.main()

            def _append_version_path(args):
                args = copy.copy(args)
                if 'autogenerate' in args and not args['autogenerate']:
                    args['version_path'] = mock.ANY
                return args

            self.do_alembic_cmd.assert_has_calls([
                mock.call(mock.ANY, func_name, **_append_version_path(kwargs))
                for kwargs in exp_kwargs
            ])
예제 #6
0
    def _main_test_helper(self, argv, func_name, exp_kwargs=[{}]):
        with mock.patch.object(sys, 'argv', argv),\
                mock.patch.object(cli, 'run_sanity_checks'),\
                mock.patch.object(cli, 'validate_revisions'):

            cli.main()

            def _append_version_path(args):
                args = copy.copy(args)
                if 'autogenerate' in args and not args['autogenerate']:
                    args['version_path'] = mock.ANY
                return args

            self.do_alembic_cmd.assert_has_calls(
                [mock.call(mock.ANY, func_name, **_append_version_path(kwargs))
                 for kwargs in exp_kwargs]
            )
예제 #7
0
 def _main_test_helper(self, argv, func_name, exp_args=(), exp_kwargs={}):
     with mock.patch.object(sys, 'argv', argv):
         cli.main()
         self.do_alembic_cmd.assert_has_calls(
             [mock.call(mock.ANY, func_name, *exp_args, **exp_kwargs)])
예제 #8
0
 def _main_test_helper(self, argv, func_name, exp_args=(), exp_kwargs=[{}]):
     with mock.patch.object(sys, "argv", argv), mock.patch.object(cli, "run_sanity_checks"):
         cli.main()
         self.do_alembic_cmd.assert_has_calls(
             [mock.call(mock.ANY, func_name, *exp_args, **kwargs) for kwargs in exp_kwargs]
         )