projects
/
OpenColorIO-Configs.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Code formatting.
[OpenColorIO-Configs.git]
/
aces_1.0.0
/
python
/
aces_ocio
/
tests
/
tests_aces_config.py
diff --git
a/aces_1.0.0/python/aces_ocio/tests/tests_aces_config.py
b/aces_1.0.0/python/aces_ocio/tests/tests_aces_config.py
index
6925511
..
4d8a38a
100644
(file)
--- a/
aces_1.0.0/python/aces_ocio/tests/tests_aces_config.py
+++ b/
aces_1.0.0/python/aces_ocio/tests/tests_aces_config.py
@@
-5,17
+5,23
@@
Defines unit tests for *ACES* configuration.
"""
Defines unit tests for *ACES* configuration.
"""
+from __future__ import division
+
import hashlib
import os
import re
import shutil
import hashlib
import os
import re
import shutil
+import sys
import tempfile
import unittest
import tempfile
import unittest
-from aces_ocio.util import files_walker
-from aces_ocio.create_aces_config import (
+sys.path.append(os.path.abspath(
+ os.path.join(os.path.dirname(__file__), '..', '..')))
+
+from aces_ocio.utilities import files_walker
+from aces_ocio.aces_config import (
ACES_OCIO_CTL_DIRECTORY_ENVIRON,
ACES_OCIO_CTL_DIRECTORY_ENVIRON,
- create
ACESC
onfig)
+ create
_ACES_c
onfig)
__author__ = 'ACES Developers'
__copyright__ = 'Copyright (C) 2014 - 2015 - ACES Developers'
__author__ = 'ACES Developers'
__copyright__ = 'Copyright (C) 2014 - 2015 - ACES Developers'
@@
-32,9
+38,9
@@
__all__ = ['REFERENCE_CONFIG_ROOT_DIRECTORY',
# TODO: Investigate how the current config has been generated to use it for
# tests.
# TODO: Investigate how the current config has been generated to use it for
# tests.
-
#
REFERENCE_CONFIG_ROOT_DIRECTORY = os.path.abspath(
-
# os.path.join(os.path.dirname(__file__)
, '..', '..'))
-REFERENCE_CONFIG_ROOT_DIRECTORY = '/colour-science/colour-ramblings/ocio/aces'
+REFERENCE_CONFIG_ROOT_DIRECTORY = os.path.abspath(
+
os.path.join(os.path.dirname(__file__), '..'
, '..', '..'))
+
#
REFERENCE_CONFIG_ROOT_DIRECTORY = '/colour-science/colour-ramblings/ocio/aces'
HASH_TEST_PATTERNS = ('\.3dl', '\.lut', '\.csp')
UNHASHABLE_TEST_PATTERNS = ('\.icc', '\.ocio')
HASH_TEST_PATTERNS = ('\.3dl', '\.lut', '\.csp')
UNHASHABLE_TEST_PATTERNS = ('\.icc', '\.ocio')
@@
-99,11
+105,12
@@
class TestACESConfig(unittest.TestCase):
hashes = {}
for path in files_walker(directory,
filters_in=filters_in,
hashes = {}
for path in files_walker(directory,
filters_in=filters_in,
- filters_out=filters_out):
+ filters_out=filters_out,
+ flags=flags):
with open(path) as file:
with open(path) as file:
-
hash
= hashlib.md5(
+
digest
= hashlib.md5(
re.sub('\s', '', file.read())).hexdigest()
re.sub('\s', '', file.read())).hexdigest()
- hashes[path.replace(directory, '')] =
hash
+ hashes[path.replace(directory, '')] =
digest
return hashes
def test_ACES_config(self):
return hashes
def test_ACES_config(self):
@@
-112,8
+119,8
@@
class TestACESConfig(unittest.TestCase):
generated configuration and comparing them to the existing one.
"""
generated configuration and comparing them to the existing one.
"""
- self.assertTrue(create
ACESC
onfig(self.__aces_ocio_ctl_directory,
- self.__temporary_directory))
+ self.assertTrue(create
_ACES_c
onfig(self.__aces_ocio_ctl_directory,
+
self.__temporary_directory))
reference_hashes = self.directory_hashes(
REFERENCE_CONFIG_ROOT_DIRECTORY,
reference_hashes = self.directory_hashes(
REFERENCE_CONFIG_ROOT_DIRECTORY,