(self, name, content)
| 433 | class TestMagicRunWithPackage(unittest.TestCase): |
| 434 | |
| 435 | def writefile(self, name, content): |
| 436 | path = os.path.join(self.tempdir.name, name) |
| 437 | d = os.path.dirname(path) |
| 438 | if not os.path.isdir(d): |
| 439 | os.makedirs(d) |
| 440 | with open(path, 'w') as f: |
| 441 | f.write(textwrap.dedent(content)) |
| 442 | |
| 443 | def setUp(self): |
| 444 | self.package = package = 'tmp{0}'.format(''.join([random.choice(string.ascii_letters) for i in range(10)])) |