X7ROOT File Manager
Current Path:
/usr/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp
usr
/
lib
/
node_modules
/
npm
/
node_modules
/
node-gyp
/
gyp
/
pylib
/
gyp
/
ðŸ“
..
📄
MSVSNew.py
(11.66 KB)
📄
MSVSProject.py
(6.24 KB)
📄
MSVSSettings.py
(44.11 KB)
📄
MSVSSettings_test.py
(64.56 KB)
📄
MSVSToolFile.py
(1.76 KB)
📄
MSVSUserFile.py
(4.97 KB)
📄
MSVSUtil.py
(9.31 KB)
📄
MSVSVersion.py
(17.02 KB)
📄
__init__.py
(21.87 KB)
📄
common.py
(20.58 KB)
📄
common_test.py
(1.92 KB)
📄
easy_xml.py
(4.87 KB)
📄
easy_xml_test.py
(3.25 KB)
📄
flock_tool.py
(1.71 KB)
ðŸ“
generator
📄
input.py
(113.65 KB)
📄
input_test.py
(3.11 KB)
📄
mac_tool.py
(22.89 KB)
📄
msvs_emulation.py
(46.76 KB)
📄
ninja_syntax.py
(5.41 KB)
📄
simple_copy.py
(1.3 KB)
📄
win_tool.py
(12.72 KB)
📄
xcode_emulation.py
(64.85 KB)
📄
xcode_ninja.py
(10.32 KB)
📄
xcodeproj_file.py
(117.66 KB)
📄
xml_fix.py
(2.12 KB)
Editing: easy_xml_test.py
#! /usr/bin/python2 # Copyright (c) 2011 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """ Unit tests for the easy_xml.py file. """ import gyp.easy_xml as easy_xml import unittest try: from cStringIO import StringIO except ImportError: from io import StringIO class TestSequenceFunctions(unittest.TestCase): def setUp(self): self.stderr = StringIO() def test_EasyXml_simple(self): self.assertEqual( easy_xml.XmlToString(['test']), '<?xml version="1.0" encoding="utf-8"?><test/>') self.assertEqual( easy_xml.XmlToString(['test'], encoding='Windows-1252'), '<?xml version="1.0" encoding="Windows-1252"?><test/>') def test_EasyXml_simple_with_attributes(self): self.assertEqual( easy_xml.XmlToString(['test2', {'a': 'value1', 'b': 'value2'}]), '<?xml version="1.0" encoding="utf-8"?><test2 a="value1" b="value2"/>') def test_EasyXml_escaping(self): original = '<test>\'"\r&\nfoo' converted = '<test>\'"
&
foo' converted_apos = converted.replace("'", ''') self.assertEqual( easy_xml.XmlToString(['test3', {'a': original}, original]), '<?xml version="1.0" encoding="utf-8"?><test3 a="%s">%s</test3>' % (converted, converted_apos)) def test_EasyXml_pretty(self): self.assertEqual( easy_xml.XmlToString( ['test3', ['GrandParent', ['Parent1', ['Child'] ], ['Parent2'] ] ], pretty=True), '<?xml version="1.0" encoding="utf-8"?>\n' '<test3>\n' ' <GrandParent>\n' ' <Parent1>\n' ' <Child/>\n' ' </Parent1>\n' ' <Parent2/>\n' ' </GrandParent>\n' '</test3>\n') def test_EasyXml_complex(self): # We want to create: target = ( '<?xml version="1.0" encoding="utf-8"?>' '<Project>' '<PropertyGroup Label="Globals">' '<ProjectGuid>{D2250C20-3A94-4FB9-AF73-11BC5B73884B}</ProjectGuid>' '<Keyword>Win32Proj</Keyword>' '<RootNamespace>automated_ui_tests</RootNamespace>' '</PropertyGroup>' '<Import Project="$(VCTargetsPath)\\Microsoft.Cpp.props"/>' '<PropertyGroup ' 'Condition="\'$(Configuration)|$(Platform)\'==' '\'Debug|Win32\'" Label="Configuration">' '<ConfigurationType>Application</ConfigurationType>' '<CharacterSet>Unicode</CharacterSet>' '</PropertyGroup>' '</Project>') xml = easy_xml.XmlToString( ['Project', ['PropertyGroup', {'Label': 'Globals'}, ['ProjectGuid', '{D2250C20-3A94-4FB9-AF73-11BC5B73884B}'], ['Keyword', 'Win32Proj'], ['RootNamespace', 'automated_ui_tests'] ], ['Import', {'Project': '$(VCTargetsPath)\\Microsoft.Cpp.props'}], ['PropertyGroup', {'Condition': "'$(Configuration)|$(Platform)'=='Debug|Win32'", 'Label': 'Configuration'}, ['ConfigurationType', 'Application'], ['CharacterSet', 'Unicode'] ] ]) self.assertEqual(xml, target) if __name__ == '__main__': unittest.main()
Upload File
Create Folder