MCPcopy Create free account
hub / github.com/AcademySoftwareFoundation/OpenColorIO / test_copy

Method test_copy

tests/python/ContextTest.py:9–27  ·  view source on GitHub ↗

Test the deepcopy() method.

(self)

Source from the content-addressed store, hash-verified

7class ContextTest(unittest.TestCase):
8
9 def test_copy(self):
10 """
11 Test the deepcopy() method.
12 """
13 cont = OCIO.Context()
14 cont.setSearchPath('testing123:testing456')
15 cont.setWorkingDir('/dir/123')
16 cont.setEnvironmentMode(OCIO.ENV_ENVIRONMENT_LOAD_PREDEFINED)
17 cont['TeSt'] = 'foobar'
18 cont['Bar'] = 'Foo'
19
20 other = copy.deepcopy(cont)
21 self.assertFalse(other is cont)
22
23 self.assertEqual(other.getCacheID(), cont.getCacheID())
24 self.assertEqual(other.getSearchPath(), cont.getSearchPath())
25 self.assertEqual(other.getWorkingDir(), cont.getWorkingDir())
26 self.assertEqual(other.getEnvironmentMode(), cont.getEnvironmentMode())
27 self.assertEqual(list(other), list(cont))
28
29 def test_interface(self):
30 """

Callers

nothing calls this directly

Calls 12

setSearchPathMethod · 0.95
setWorkingDirMethod · 0.95
setEnvironmentModeMethod · 0.95
getCacheIDMethod · 0.95
getSearchPathMethod · 0.95
getWorkingDirMethod · 0.95
getEnvironmentModeMethod · 0.95
ContextMethod · 0.45
getCacheIDMethod · 0.45
getSearchPathMethod · 0.45
getWorkingDirMethod · 0.45
getEnvironmentModeMethod · 0.45

Tested by

no test coverage detected