diff options
| author | Steven Knight <knight@baldmt.com> | 2005-01-03 15:29:43 (GMT) |
|---|---|---|
| committer | Steven Knight <knight@baldmt.com> | 2005-01-03 15:29:43 (GMT) |
| commit | 49766df7a53c47fdc9d30549595efe1cfcd479b0 (patch) | |
| tree | f19db2c2638da5a4487384d05caeca4488860f2a /src/engine/SCons/Options/PathOptionTests.py | |
| parent | 203974e18ca6869965f194eb07fcdd8ccc8c91c9 (diff) | |
| download | SCons-49766df7a53c47fdc9d30549595efe1cfcd479b0.zip SCons-49766df7a53c47fdc9d30549595efe1cfcd479b0.tar.gz SCons-49766df7a53c47fdc9d30549595efe1cfcd479b0.tar.bz2 | |
Add a PathOptions.PathAccept validator. (Kevin Quick)
Diffstat (limited to 'src/engine/SCons/Options/PathOptionTests.py')
| -rw-r--r-- | src/engine/SCons/Options/PathOptionTests.py | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/engine/SCons/Options/PathOptionTests.py b/src/engine/SCons/Options/PathOptionTests.py index 9749ee7..22e79ae 100644 --- a/src/engine/SCons/Options/PathOptionTests.py +++ b/src/engine/SCons/Options/PathOptionTests.py @@ -159,6 +159,28 @@ class PathOptionTestCase(unittest.TestCase): except: raise "did not catch expected UserError" + def test_PathAccept(self): + """Test the PathAccept validator""" + opts = SCons.Options.Options() + opts.Add(SCons.Options.PathOption('test', + 'test option help', + '/default/path', + SCons.Options.PathOption.PathAccept)) + + test = TestCmd.TestCmd(workdir='') + test.subdir('dir') + test.write('file', "file\n") + + o = opts.options[0] + + o.validator('X', test.workpath('file'), {}) + + d = test.workpath('d') + o.validator('X', d, {}) + + dne = test.workpath('does_not_exist') + o.validator('X', dne, {}) + def test_validator(self): """Test the PathOption validator argument""" opts = SCons.Options.Options() |
