Exemplo n.º 1
0
    def test__yesno2bool_1(self):
        """yesno2bool(...)"""
        positives = ('y','yes','true','on','enable','enabled')
        negatives = ('n','no','false','off','disable','disabled')
        for p in positives:
            self.assertIs(tested.yesno2bool(p), True)
            self.assertIs(tested.yesno2bool(p.upper()), True)
        for n in negatives:
            self.assertIs(tested.yesno2bool(n), False)
            self.assertIs(tested.yesno2bool(n.upper()), False)

        self.assertIs(tested.yesno2bool('foo'), None)
Exemplo n.º 2
0
 def test__paths2list_5(self):
     """paths2list('"C:\windows":foo:bar') should == ['C:\windows', 'foo', 'bar']"""
     self.assertEqual(tested.paths2list('"C:\windows":foo:bar'), ['C:\windows', 'foo', 'bar'])
Exemplo n.º 3
0
 def test__build_iresubst_dict_1(self):
     """_build_iresubst_dict({}) should == {}"""
     self.assertEqual(tested._build_iresubst_dict({}),{})
Exemplo n.º 4
0
 def test__resubst_3(self):
     """_resubst('foo $bar', {'bar' : 'XBAR'}) should return 'foo XBAR'"""
     self.assertEqual(tested._resubst('foo $bar', {'bar' : 'XBAR'}), 'foo XBAR')
Exemplo n.º 5
0
 def test__resubst_1(self):
     """_resubst('foo bar') should return 'foo bar'"""
     self.assertEqual(tested._resubst('foo bar'), 'foo bar')
Exemplo n.º 6
0
 def test__cdefs2list_6(self):
     """cdefs2list("'-Dfoo=\"string with spaces\"' -Dother") should == ["-Dfoo=string with spaces"]"""
     self.assertEqual(tested.cdefs2list("'-Dfoo=\"string with spaces\"' -Dother"), ["-Dfoo=\"string with spaces\"", '-Dother'])
Exemplo n.º 7
0
 def test__cdefs2list_4(self):
     """cdefs2list('-Dfoo="string with spaces"') should == ['-Dfoo=string with spaces']"""
     self.assertEqual(tested.cdefs2list('-Dfoo="string with spaces"'), ['-Dfoo=string with spaces'])
Exemplo n.º 8
0
 def test__cdefs2list_2(self):
     """cdefs2list('-Dxyz') should == ['-Dxyz']"""
     self.assertEqual(tested.cdefs2list('-Dxyz'),['-Dxyz'])
Exemplo n.º 9
0
 def test__invert_dict_3(self):
     """_invert_dict({ 'v' : 'w', 'x' : 'y' }) should == { 'w' : 'v', 'y' : 'x'}"""
     self.assertEqual(tested._invert_dict({'v' : 'w', 'x' : 'y'}), { 'w' : 'v', 'y' : 'x'})
Exemplo n.º 10
0
 def test__invert_dict_2(self):
     """_invert_dict({ 'x' : 'y' }) should == { 'y' : 'x'}"""
     self.assertEqual(tested._invert_dict({'x' : 'y'}), { 'y' : 'x'})
Exemplo n.º 11
0
 def test__invert_dict_1(self):
     """_invert_dict({}) should == {}"""
     self.assertEqual(tested._invert_dict({}), {})
Exemplo n.º 12
0
 def test__compose_mappings_2(self):
     """_compose_mappings({'uuu' : 'vvv', 'xxx' : 'yyy'} ,{ 'vvv' : 'VVV', 'yyy' : 'YYY'}) should == {'uuu' : 'VVV'}"""
     self.assertEqual(tested._compose_mappings({'uuu' : 'vvv', 'xxx' : 'yyy'}, { 'vvv' : 'VVV', 'yyy' : 'YYY'}), {'uuu' : 'VVV', 'xxx' : 'YYY'})
Exemplo n.º 13
0
 def test__compose_mappings_1(self):
     """_compose_mappings({},{}) should == {}"""
     self.assertEqual(tested._compose_mappings({},{}),{})
Exemplo n.º 14
0
 def test__build_iresubst_dict_2(self):
     """_build_iresubst_dict({'xxx' : 'yyy', 'vvv' : 'www'}) should == {'yyy' : '${xxx}', 'www' : '${vvv}'}"""
     self.assertEqual(tested._build_iresubst_dict({'xxx' : 'yyy', 'vvv' : 'www'}), {'yyy' : '${xxx}', 'www' : '${vvv}'})
Exemplo n.º 15
0
 def test__cdefs2list_0(self):
     """cdefs2list('') should be an instance of SCons.Util.CLVar"""
     self.assertIsInstance(tested.cdefs2list(''), SCons.Util.CLVar)
Exemplo n.º 16
0
 def test__cdefs2list_1(self):
     """cdefs2list('') should == []"""
     self.assertEqual(tested.cdefs2list(''),[])
Exemplo n.º 17
0
 def test__flags2list_1(self):
     """flags2list('') should == []"""
     self.assertEqual(tested.flags2list(''),[])
Exemplo n.º 18
0
 def test__cdefs2list_3(self):
     """cdefs2list('-Dfoo -Dbar') should == ['-Dfoo', '-Dbar']"""
     self.assertEqual(tested.cdefs2list('-Dfoo -Dbar'), ['-Dfoo', '-Dbar'])
Exemplo n.º 19
0
 def test__flags2list_2(self):
     """flags2list('xyz') should == ['xyz']"""
     self.assertEqual(tested.flags2list('xyz'),['xyz'])
Exemplo n.º 20
0
 def test__cdefs2list_5(self):
     """cdefs2list("-Dfoo='string with spaces'") should == ["-Dfoo=string with spaces"]"""
     self.assertEqual(tested.cdefs2list("-Dfoo='string with spaces'"), ["-Dfoo=string with spaces"])
Exemplo n.º 21
0
 def test__flags2list_3(self):
     """flags2list('foo bar') should == ['foo', 'bar']"""
     self.assertEqual(tested.flags2list('foo bar'), ['foo', 'bar'])
Exemplo n.º 22
0
 def test__paths2list_1(self):
     """paths2list('') should == []"""
     self.assertEqual(tested.paths2list(''),[])
Exemplo n.º 23
0
 def test__paths2list_2(self):
     """paths2list('xyz') should == ['xyz']"""
     self.assertEqual(tested.paths2list('xyz'),['xyz'])
Exemplo n.º 24
0
 def test__resubst_2(self):
     """_resubst('foo bar', {'foo' : 'XFOO'}) should return 'foo bar'"""
     self.assertEqual(tested._resubst('foo bar', {'foo' : 'XFOO'}), 'foo bar')
Exemplo n.º 25
0
 def test__paths2list_4(self):
     """paths2list('foo:bar') should == ['foo', 'bar']"""
     self.assertEqual(tested.paths2list('foo:bar'), ['foo', 'bar'])
Exemplo n.º 26
0
 def test__resubst_5(self):
     """_resubst('$foo $bar', {'foo' : '$bar', 'bar' : 'XBAR'}) should return '$bar XBAR'"""
     self.assertEqual(tested._resubst('$foo $bar', {'foo' : '$bar', 'bar' : 'XBAR'}), '$bar XBAR')
Exemplo n.º 27
0
 def test__resubst_8(self):
     """_resubst('${foo} ${bar}', {'foo' : '${bar}', 'bar' : 'XBAR'}) should return '${bar} XBAR'"""
     self.assertEqual(tested._resubst('${foo} ${bar}', {'foo' : '${bar}', 'bar' : 'XBAR'}), '${bar} XBAR')