# 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
    c = OverObj('.', 'anchorhub-out', True)
    assert v.validate(c)


@raises(ValidationException)
def test_validate_same_input_output():
    """
    validate_overwrite.py: input/output are the same, overwrite set to False
    """
    a = OverObj('.', '.', False)
    assert v.validate(a)


@raises(ValidationException)
def test_validate_same_input_output_relative_abs_dirs():
    """
    validate_overwrite.py: input/output are same, mixing relative/absolute paths
    """
    cwd = os.getcwd()
    a = OverObj('.', cwd, False)
    assert v.validate(a)


@raises(ValidationException)
def test_validate_same_input_output_relative_dirs():
    """
    validate_overwrite.py: input/output are same, using only relative paths
    """
    cwd = os.getcwd()
    # Find last path separator in cwd; dir is everything after that

# 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

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


@raises(ValidationException)
def test_validate_same_input_output():
    """
    validate_overwrite.py: input/output are the same, overwrite set to False
    """
    a = OverObj('.', '.', False)
    assert v.validate(a)


@raises(ValidationException)
def test_validate_same_input_output_relative_abs_dirs():
    """
    validate_overwrite.py: input/output are same, mixing relative/absolute paths
    """
    cwd = os.getcwd()
    a = OverObj('.', cwd, False)
    assert v.validate(a)


@raises(ValidationException)
def test_validate_same_input_output_relative_dirs():
    """
    validate_overwrite.py: input/output are same, using only relative paths
    """
    cwd = os.getcwd()
    # Find last path separator in cwd; dir is everything after that

    dir = cwd[cwd.rfind(get_path_separator()):]