Example #1
0
    def test_given_no_release_then_parser_error_called_specifying_no_module_version(self):
        self.args.module_name = "build"
        expected_error_msg = 'Module version not specified'

        dls_release.check_parsed_arguments_valid(self.args, self.parser)

        self.mock_error.assert_called_once_with(expected_error_msg)
Example #2
0
    def test_given_git_and_tools_area_else_good_options_then_error_not_raised(self):

        self.args.module_name = "module"
        self.args.release = "version"
        self.args.area = "tools"

        dls_release.check_parsed_arguments_valid(self.args, self.parser)

        self.assertFalse(self.mock_error.call_count)
Example #3
0
    def test_given_default_area_and_module_of_redirector_then_parser_error_not_called(self):

        self.args.module_name = "redirector"
        self.args.release = "12"
        self.args.area = "support"

        dls_release.check_parsed_arguments_valid(self.args, self.parser)

        self.assertFalse(self.mock_error.call_count)
Example #4
0
    def test_given_git_and_etc_area_else_good_options_then_raise_error(self):

        self.args.module_name = "module"
        self.args.release = "version"
        self.args.area = "etc"

        expected_error_message = self.args.area + " area not supported by git"

        dls_release.check_parsed_arguments_valid(self.args, self.parser)

        self.mock_error.assert_called_once_with(expected_error_message)
Example #5
0
    def test_given_area_option_of_etc_and_module_equals_redirector_then_parser_error_specifying_this(self):
        self.args.module_name = "redirector"
        self.args.release = "12"
        self.args.area = "etc"

        expected_error_msg = 'Cannot release etc/build or etc/redirector as'
        expected_error_msg += ' modules - use configure system instead'

        dls_release.check_parsed_arguments_valid(self.args, self.parser)

        self.mock_error.assert_called_once_with(expected_error_msg)
Example #6
0
    def test_given_next_version_and_git_flag_then_parser_error_called(self):

        self.args.module_name = "module_name"
        self.args.release = "12"
        self.args.area = "support"
        self.args.next_version = True

        expected_error_message = "When git is specified, version number must be provided"

        dls_release.check_parsed_arguments_valid(self.args, self.parser)

        self.mock_error.assert_called_once_with(expected_error_message)