# Path: spdx/parsers/validations.py
# def validate_is_free_form_text(value, optional=False):
# def validate_tool_name(value, optional=False):
# def validate_person_name(value, optional=False):
# def validate_org_name(value, optional=False):
# def validate_data_lics(value):
# def validate_doc_name(value, optional=False):
# def validate_pkg_supplier(value, optional=False):
# def validate_pkg_originator(value, optional=False):
# def validate_pkg_homepage(value, optional=False):
# def validate_pkg_cr_text(value, optional=False):
# def validate_pkg_summary(value, optional=False):
# def validate_pkg_desc(value, optional=False):
# def validate_pkg_comment(value, optional=False):
# def validate_pkg_attribution_text(value, optional=False):
# def validate_file_attribution_text(value, optional=False):
# def validate_snippet_attribution_text(value, optional=False):
# def validate_pkg_ext_ref_category(value, optional=False):
# def validate_pkg_ext_ref_type(value, optional=False):
# def validate_pkg_ext_ref_comment(value, optional=False):
# def validate_doc_comment(value, optional=False):
# def validate_doc_spdx_id(value, optional=False):
# def validate_doc_namespace(value, optional=False):
# def validate_creator(value, optional=False):
# def validate_creation_comment(value, optional=False):
# def validate_reviewer(value, optional=False):
# def validate_review_comment(value, optional=False):
# def validate_annotator(value, optional=False):
# def validate_annotation_comment(value, optional=False):
# def validate_annotation_type(value, optional=False):
# def validate_relationship_comment(value, optional=False):
# def validate_pkg_spdx_id(value, optional=False):
# def validate_pkg_files_analyzed(value, optional=False):
# def validate_pkg_src_info(value, optional=False):
# def validate_pkg_lics_comment(value, optional=False):
# def validate_file_spdx_id(value, optional=False):
# def validate_file_comment(value, optional=False):
# def validate_file_lics_comment(value, optional=False):
# def validate_file_cpyright(value, optional=False):
# def validate_lics_from_file(value, optional=False):
# def validate_file_notice(value, optional=False):
# def validate_lics_conc(value, optional=False):
# def validate_file_lics_in_file(value, optional=False):
# def validate_extracted_lic_id(value, optional=False):
# def validate_extr_lic_name(value, optional=False):
# def validate_snippet_spdx_id(value, optional=False):
# def validate_snip_comment(value, optional=False):
# def validate_snippet_copyright(value, optional=False):
# def validate_snip_lic_comment(value, optional=False):
# def validate_snip_file_spdxid(value, optional=False):
# def validate_snip_lics_info(value, optional=False):
#     TEXT_RE = re.compile(r"<text>(.|\n)*</text>", re.UNICODE)
#     TEXT_RE = re.compile(r"SPDXRef-([A-Za-z0-9\.\-]+)", re.UNICODE)
#     TEXT_RE = re.compile(r"SPDXRef-([A-Za-z0-9.\-]+)", re.UNICODE)
# 
# Path: spdx/utils.py
# def datetime_iso_format(date):
# def datetime_from_iso_format(string):
#     def to_value(self):
#     def __str__(self):
#     def to_value(self):
#     def __str__(self):
#     def __repr__(self):
#     def __eq__(self, other):
#     def to_value(self):
#     def __str__(self):
#     def t_LP(self, t):
#     def t_RP(self, t):
#     def t_AND(self, t):
#     def t_OR(self, t):
#     def t_whitespace(self, t):
#     def t_LICENSE(self, t):
#     def t_error(self, t):
#     def input(self, data):
#     def token(self):
#     def build(self, **kwargs):
#     def __init__(self):
#     def p_disjunction_1(self, p):
#     def p_disjunction_2(self, p):
#     def p_conjunction_1(self, p):
#     def p_conjunction_2(self, p):
#     def p_license_atom_1(self, p):
#     def p_license_atom_2(self, p):
#     def p_error(self, p):
#     def build(self, **kwargs):
#     def parse(self, data):
# DATE_ISO_REGEX = re.compile(
#     r"(\d\d\d\d)-(\d\d)-(\d\d)T(\d\d):(\d\d):(\d\d)Z", re.UNICODE
# )
# DATE_ISO_YEAR_GRP = 1
# DATE_ISO_MONTH_GRP = 2
# DATE_ISO_DAY_GRP = 3
# DATE_ISO_HOUR_GRP = 4
# DATE_ISO_MIN_GRP = 5
# DATE_ISO_SEC_GRP = 6
# class NoAssert(object):
# class UnKnown(object):
# class SPDXNone(object):
# class LicenseListLexer(object):
# class LicenseListParser(object):


from unittest import TestCase
from spdx.parsers import validations
from spdx import utils

# Copyright (c) SPDX Python tools authors
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#     http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.




class TestValidations(TestCase):
    maxDiff = None

    def test_validate_pkg_cr_text_does_not_crash_on_None(self):
        validations.validate_pkg_cr_text(None)

    def test_validate_pkg_cr_text_does_not_crash_on_NoAssert_or_SPDXNone(self):
        validations.validate_pkg_cr_text(utils.NoAssert())

# Path: spdx/parsers/validations.py
# def validate_is_free_form_text(value, optional=False):
# def validate_tool_name(value, optional=False):
# def validate_person_name(value, optional=False):
# def validate_org_name(value, optional=False):
# def validate_data_lics(value):
# def validate_doc_name(value, optional=False):
# def validate_pkg_supplier(value, optional=False):
# def validate_pkg_originator(value, optional=False):
# def validate_pkg_homepage(value, optional=False):
# def validate_pkg_cr_text(value, optional=False):
# def validate_pkg_summary(value, optional=False):
# def validate_pkg_desc(value, optional=False):
# def validate_pkg_comment(value, optional=False):
# def validate_pkg_attribution_text(value, optional=False):
# def validate_file_attribution_text(value, optional=False):
# def validate_snippet_attribution_text(value, optional=False):
# def validate_pkg_ext_ref_category(value, optional=False):
# def validate_pkg_ext_ref_type(value, optional=False):
# def validate_pkg_ext_ref_comment(value, optional=False):
# def validate_doc_comment(value, optional=False):
# def validate_doc_spdx_id(value, optional=False):
# def validate_doc_namespace(value, optional=False):
# def validate_creator(value, optional=False):
# def validate_creation_comment(value, optional=False):
# def validate_reviewer(value, optional=False):
# def validate_review_comment(value, optional=False):
# def validate_annotator(value, optional=False):
# def validate_annotation_comment(value, optional=False):
# def validate_annotation_type(value, optional=False):
# def validate_relationship_comment(value, optional=False):
# def validate_pkg_spdx_id(value, optional=False):
# def validate_pkg_files_analyzed(value, optional=False):
# def validate_pkg_src_info(value, optional=False):
# def validate_pkg_lics_comment(value, optional=False):
# def validate_file_spdx_id(value, optional=False):
# def validate_file_comment(value, optional=False):
# def validate_file_lics_comment(value, optional=False):
# def validate_file_cpyright(value, optional=False):
# def validate_lics_from_file(value, optional=False):
# def validate_file_notice(value, optional=False):
# def validate_lics_conc(value, optional=False):
# def validate_file_lics_in_file(value, optional=False):
# def validate_extracted_lic_id(value, optional=False):
# def validate_extr_lic_name(value, optional=False):
# def validate_snippet_spdx_id(value, optional=False):
# def validate_snip_comment(value, optional=False):
# def validate_snippet_copyright(value, optional=False):
# def validate_snip_lic_comment(value, optional=False):
# def validate_snip_file_spdxid(value, optional=False):
# def validate_snip_lics_info(value, optional=False):
#     TEXT_RE = re.compile(r"<text>(.|\n)*</text>", re.UNICODE)
#     TEXT_RE = re.compile(r"SPDXRef-([A-Za-z0-9\.\-]+)", re.UNICODE)
#     TEXT_RE = re.compile(r"SPDXRef-([A-Za-z0-9.\-]+)", re.UNICODE)
# 
# Path: spdx/utils.py
# def datetime_iso_format(date):
# def datetime_from_iso_format(string):
#     def to_value(self):
#     def __str__(self):
#     def to_value(self):
#     def __str__(self):
#     def __repr__(self):
#     def __eq__(self, other):
#     def to_value(self):
#     def __str__(self):
#     def t_LP(self, t):
#     def t_RP(self, t):
#     def t_AND(self, t):
#     def t_OR(self, t):
#     def t_whitespace(self, t):
#     def t_LICENSE(self, t):
#     def t_error(self, t):
#     def input(self, data):
#     def token(self):
#     def build(self, **kwargs):
#     def __init__(self):
#     def p_disjunction_1(self, p):
#     def p_disjunction_2(self, p):
#     def p_conjunction_1(self, p):
#     def p_conjunction_2(self, p):
#     def p_license_atom_1(self, p):
#     def p_license_atom_2(self, p):
#     def p_error(self, p):
#     def build(self, **kwargs):
#     def parse(self, data):
# DATE_ISO_REGEX = re.compile(
#     r"(\d\d\d\d)-(\d\d)-(\d\d)T(\d\d):(\d\d):(\d\d)Z", re.UNICODE
# )
# DATE_ISO_YEAR_GRP = 1
# DATE_ISO_MONTH_GRP = 2
# DATE_ISO_DAY_GRP = 3
# DATE_ISO_HOUR_GRP = 4
# DATE_ISO_MIN_GRP = 5
# DATE_ISO_SEC_GRP = 6
# class NoAssert(object):
# class UnKnown(object):
# class SPDXNone(object):
# class LicenseListLexer(object):
# class LicenseListParser(object):


# Path: tests/test_parsers_validation.py
from unittest import TestCase
from spdx.parsers import validations
from spdx import utils


# Copyright (c) SPDX Python tools authors
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#     http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.




class TestValidations(TestCase):
    maxDiff = None

    def test_validate_pkg_cr_text_does_not_crash_on_None(self):
        validations.validate_pkg_cr_text(None)

    def test_validate_pkg_cr_text_does_not_crash_on_NoAssert_or_SPDXNone(self):
        validations.validate_pkg_cr_text(utils.NoAssert())

        validations.validate_pkg_cr_text(utils.SPDXNone())