Beispiel #1
0
 def testAnalyzeFile(self):
     path = os.path.abspath('File.py')
     source = dedent("""\
         CONSTANT = 1
     """)
     expectedDict = ModuleDict()
     expectedDict.enterModule('File')
     expectedDict.addProperty(None, 'CONSTANT')
     outDict = analyzeFile(path, getSafeTree(source, 1))
     self.assertEquals(outDict, expectedDict, '%r != %r' % (outDict._modules, expectedDict._modules))
Beispiel #2
0
 def testAnalyzeFile(self):
     path = os.path.abspath('File.py')
     source = dedent("""\
         CONSTANT = 1
     """)
     expectedDict = ModuleDict()
     expectedDict.enterModule('File')
     expectedDict.addProperty(None, 'CONSTANT')
     outDict = analyzeFile(path, getSafeTree(source, 1))
     self.assertEqual(outDict, expectedDict, '%r != %r' % (outDict._modules, expectedDict._modules))