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)
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'])
def test__build_iresubst_dict_1(self): """_build_iresubst_dict({}) should == {}""" self.assertEqual(tested._build_iresubst_dict({}),{})
def test__resubst_3(self): """_resubst('foo $bar', {'bar' : 'XBAR'}) should return 'foo XBAR'""" self.assertEqual(tested._resubst('foo $bar', {'bar' : 'XBAR'}), 'foo XBAR')
def test__resubst_1(self): """_resubst('foo bar') should return 'foo bar'""" self.assertEqual(tested._resubst('foo bar'), 'foo bar')
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'])
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'])
def test__cdefs2list_2(self): """cdefs2list('-Dxyz') should == ['-Dxyz']""" self.assertEqual(tested.cdefs2list('-Dxyz'),['-Dxyz'])
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'})
def test__invert_dict_2(self): """_invert_dict({ 'x' : 'y' }) should == { 'y' : 'x'}""" self.assertEqual(tested._invert_dict({'x' : 'y'}), { 'y' : 'x'})
def test__invert_dict_1(self): """_invert_dict({}) should == {}""" self.assertEqual(tested._invert_dict({}), {})
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'})
def test__compose_mappings_1(self): """_compose_mappings({},{}) should == {}""" self.assertEqual(tested._compose_mappings({},{}),{})
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}'})
def test__cdefs2list_0(self): """cdefs2list('') should be an instance of SCons.Util.CLVar""" self.assertIsInstance(tested.cdefs2list(''), SCons.Util.CLVar)
def test__cdefs2list_1(self): """cdefs2list('') should == []""" self.assertEqual(tested.cdefs2list(''),[])
def test__flags2list_1(self): """flags2list('') should == []""" self.assertEqual(tested.flags2list(''),[])
def test__cdefs2list_3(self): """cdefs2list('-Dfoo -Dbar') should == ['-Dfoo', '-Dbar']""" self.assertEqual(tested.cdefs2list('-Dfoo -Dbar'), ['-Dfoo', '-Dbar'])
def test__flags2list_2(self): """flags2list('xyz') should == ['xyz']""" self.assertEqual(tested.flags2list('xyz'),['xyz'])
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"])
def test__flags2list_3(self): """flags2list('foo bar') should == ['foo', 'bar']""" self.assertEqual(tested.flags2list('foo bar'), ['foo', 'bar'])
def test__paths2list_1(self): """paths2list('') should == []""" self.assertEqual(tested.paths2list(''),[])
def test__paths2list_2(self): """paths2list('xyz') should == ['xyz']""" self.assertEqual(tested.paths2list('xyz'),['xyz'])
def test__resubst_2(self): """_resubst('foo bar', {'foo' : 'XFOO'}) should return 'foo bar'""" self.assertEqual(tested._resubst('foo bar', {'foo' : 'XFOO'}), 'foo bar')
def test__paths2list_4(self): """paths2list('foo:bar') should == ['foo', 'bar']""" self.assertEqual(tested.paths2list('foo:bar'), ['foo', 'bar'])
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')
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')