Exemplo n.º 1
0
 def test_writes_package(self):
     resource = StubPackageResource('foo', [('bar.py', 'woo')])
     pkg = resource.getResource()
     self.addCleanup(resource.finishedWith, pkg)
     self.assertEqual('', file(os.path.join(pkg.base, 'foo',
         '__init__.py')).read())
     self.assertEqual('woo', file(os.path.join(pkg.base, 'foo',
         'bar.py')).read())
Exemplo n.º 2
0
 def test_no__init__(self):
     resource = StubPackageResource('foo', [('bar.py', 'woo')], init=False)
     pkg = resource.getResource()
     self.addCleanup(resource.finishedWith, pkg)
     self.assertFalse(os.path.exists(os.path.join(pkg.base, 'foo',
         '__init__.py')))