# Path: libtaxii/validation.py
# def do_check(var, varname, type=None, regex_tuple=None, value_tuple=None, can_be_none=False):
# def check_timestamp_label(timestamp_label, varname, can_be_none=False):
#     def __init__(self, valid, error_log):
#     def __init__(self, schema_file):
#     def validate_file(self, file_location):
#     def validate_string(self, xml_string):
#     def validate_etree(self, etree_xml):
#     def __init__(self):
#     def __init__(self):
# class SchemaValidationResult(object):
# class SchemaValidator(object):
# class TAXII10Validator(SchemaValidator):
# class TAXII11Validator(SchemaValidator):
# TAXII_10_SCHEMA = os.path.join(_pkg_dir, "xsd", "TAXII_XMLMessageBinding_Schema.xsd")
# TAXII_11_SCHEMA = os.path.join(_pkg_dir, "xsd", "TAXII_XMLMessageBinding_Schema_11.xsd")
#     TAXII_10_SCHEMA = TAXII_10_SCHEMA
#     TAXII_11_SCHEMA = TAXII_11_SCHEMA


import unittest
from libtaxii.validation import do_check, message_id_regex_10
# Copyright (c) 2017, The MITRE Corporation
# For license information, see the LICENSE.txt file




class ValidationTests(unittest.TestCase):

    def test_numeric_regex_valid(self):
        # This message ID is valid. It should not raise an exception
        do_check("12345", "Test Value", regex_tuple=message_id_regex_10)

    # See: https://github.com/TAXIIProject/libtaxii/issues/166
    def test_numeric_regex_invalid_end(self):
        # This message ID is not valid.
        args = ("12345abcd", "Message ID")

# Path: libtaxii/validation.py
# def do_check(var, varname, type=None, regex_tuple=None, value_tuple=None, can_be_none=False):
# def check_timestamp_label(timestamp_label, varname, can_be_none=False):
#     def __init__(self, valid, error_log):
#     def __init__(self, schema_file):
#     def validate_file(self, file_location):
#     def validate_string(self, xml_string):
#     def validate_etree(self, etree_xml):
#     def __init__(self):
#     def __init__(self):
# class SchemaValidationResult(object):
# class SchemaValidator(object):
# class TAXII10Validator(SchemaValidator):
# class TAXII11Validator(SchemaValidator):
# TAXII_10_SCHEMA = os.path.join(_pkg_dir, "xsd", "TAXII_XMLMessageBinding_Schema.xsd")
# TAXII_11_SCHEMA = os.path.join(_pkg_dir, "xsd", "TAXII_XMLMessageBinding_Schema_11.xsd")
#     TAXII_10_SCHEMA = TAXII_10_SCHEMA
#     TAXII_11_SCHEMA = TAXII_11_SCHEMA


# Path: libtaxii/test/validation_test.py
import unittest
from libtaxii.validation import do_check, message_id_regex_10

# Copyright (c) 2017, The MITRE Corporation
# For license information, see the LICENSE.txt file




class ValidationTests(unittest.TestCase):

    def test_numeric_regex_valid(self):
        # This message ID is valid. It should not raise an exception
        do_check("12345", "Test Value", regex_tuple=message_id_regex_10)

    # See: https://github.com/TAXIIProject/libtaxii/issues/166
    def test_numeric_regex_invalid_end(self):
        # This message ID is not valid.
        args = ("12345abcd", "Message ID")

        kwargs = {'regex_tuple': message_id_regex_10}