Followon to PR #4348: more bool fixes
[scons.git] / SCons / Tool / wixTests.py
blob26b2295b81cae2c42d66cd0fc000f56f02993853
2 # __COPYRIGHT__
4 # Permission is hereby granted, free of charge, to any person obtaining
5 # a copy of this software and associated documentation files (the
6 # "Software"), to deal in the Software without restriction, including
7 # without limitation the rights to use, copy, modify, merge, publish,
8 # distribute, sublicense, and/or sell copies of the Software, and to
9 # permit persons to whom the Software is furnished to do so, subject to
10 # the following conditions:
12 # The above copyright notice and this permission notice shall be included
13 # in all copies or substantial portions of the Software.
15 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
16 # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
17 # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18 # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
19 # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
20 # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
24 __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
26 import unittest
27 import os.path
28 import os
30 import SCons.Errors
31 from SCons.Tool.wix import *
32 from SCons.Environment import Environment
34 import TestCmd
37 # create fake candle and light, so the tool's exists() method will succeed
38 test = TestCmd.TestCmd(workdir = '')
39 test.write('candle.exe', 'rem this is candle')
40 test.write('light.exe', 'rem this is light')
41 os.environ['PATH'] += os.pathsep + test.workdir
43 class WixTestCase(unittest.TestCase):
44 def test_vars(self) -> None:
45 """Test that WiX tool adds vars"""
46 env = Environment(tools=['wix'])
47 assert env['WIXCANDLE'] is not None
48 assert env['WIXCANDLEFLAGS'] is not None
49 assert env['WIXLIGHTFLAGS'] is not None
50 assert env.subst('$WIXOBJSUF') == '.wixobj'
51 assert env.subst('$WIXSRCSUF') == '.wxs'
53 if __name__ == "__main__":
54 unittest.main()
56 # Local Variables:
57 # tab-width:4
58 # indent-tabs-mode:nil
59 # End:
60 # vim: set expandtab tabstop=4 shiftwidth=4: