# Path: anchorhub/exceptions/validationexception.py
# class ValidationException(Exception):
#     def __init__(self, *args, **kwargs):
#         Exception.__init__(self, *args, **kwargs)
# 
# Path: anchorhub/compatibility.py
# def get_path_separator():
#     """
#     Returns the appropriate file path separator depending on operating
#     system. That is, when run on UNIX-like systems it returns a forward slash
#     ('/'), and for Windows it returns a backslash ('\')
#     :return: String. The file path separator for the current operating system.
#     """
#     if os.name == 'nt':
#         return '\\'
#     else:
#         return '/'


import os
import anchorhub.validation.validate_overwrite as v
from nose.tools import *
from anchorhub.exceptions.validationexception import ValidationException
from anchorhub.compatibility import get_path_separator



class OverObj(object):
    """
    Dummy class for testing overwrite
    """
    def __init__(self, input=None, output=None, overwrite=None):
        if input is not None:
            self.input = input
        if output is not None:
            self.output = output
        if overwrite is not None:
            self.overwrite = overwrite


def test_validate_correct():
    """
    validate_overwrite.py: Test various correct objects
    """
    a = OverObj('.', 'anchorhub-out', False)
    assert v.validate(a)

    b = OverObj('.', '.', True)
    assert v.validate(b)

    c = OverObj('.', 'anchorhub-out', True)
    assert v.validate(c)



# Path: anchorhub/exceptions/validationexception.py
# class ValidationException(Exception):
#     def __init__(self, *args, **kwargs):
#         Exception.__init__(self, *args, **kwargs)
# 
# Path: anchorhub/compatibility.py
# def get_path_separator():
#     """
#     Returns the appropriate file path separator depending on operating
#     system. That is, when run on UNIX-like systems it returns a forward slash
#     ('/'), and for Windows it returns a backslash ('\')
#     :return: String. The file path separator for the current operating system.
#     """
#     if os.name == 'nt':
#         return '\\'
#     else:
#         return '/'


# Path: anchorhub/validation/tests/test_validate_overwrite.py
import os
import anchorhub.validation.validate_overwrite as v
from nose.tools import *
from anchorhub.exceptions.validationexception import ValidationException
from anchorhub.compatibility import get_path_separator




class OverObj(object):
    """
    Dummy class for testing overwrite
    """
    def __init__(self, input=None, output=None, overwrite=None):
        if input is not None:
            self.input = input
        if output is not None:
            self.output = output
        if overwrite is not None:
            self.overwrite = overwrite


def test_validate_correct():
    """
    validate_overwrite.py: Test various correct objects
    """
    a = OverObj('.', 'anchorhub-out', False)
    assert v.validate(a)

    b = OverObj('.', '.', True)
    assert v.validate(b)

    c = OverObj('.', 'anchorhub-out', True)
    assert v.validate(c)



@raises(ValidationException)