Skip to content

Commit eb93cd5

Browse files
committed
Implement test case for non-serializable json
1 parent b77d3e8 commit eb93cd5

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

SCons/EnvironmentTests.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3177,11 +3177,12 @@ def test_NoClean(self) -> None:
31773177
def test_Dump(self) -> None:
31783178
"""Test the Dump() method"""
31793179

3180-
env = self.TestEnvironment(FOO = 'foo')
3180+
env = self.TestEnvironment(FOO='foo', FOOFLAGS=CLVar('--bar --baz'))
31813181
assert env.Dump('FOO') == "'foo'", env.Dump('FOO')
31823182
assert len(env.Dump()) > 200, env.Dump() # no args version
31833183

31843184
assert env.Dump('FOO', 'json') == '"foo"' # JSON key version
3185+
self.assertEqual(env.Dump('FOOFLAGS', 'json'), '"<<non-serializable: CLVar>>"')
31853186
import json
31863187
env_dict = json.loads(env.Dump(format = 'json'))
31873188
assert env_dict['FOO'] == 'foo' # full JSON version

0 commit comments

Comments
 (0)