

def test_policy_overwrite_template_content(self):
    os.mkdir(self.build_dir)
    test_file = os.path.join(self.build_dir, 'filea')
    with open(test_file, 'w') as f:
        f.write('Some random text')
    os.chmod(test_file, (stat.S_IRUSR | stat.S_IWUSR))
    self.build_scaffold('test-template-6', overwrite_target_root=True, existing_policy=Scaffold.EXISTING_OVERWRITE, variables={
        'name': 'happyman',
        'age': 25,
    })
    assert self.exists('filea', type='file')
    assert ('My name is happyman' in self.contents('filea'))
    assert (get_permissions(test_file) == 436)
    assert self.logged('Rendering and overwriting template')

dataset/ETHPy150Open fgimian/flaskage/tests/test_scaffold.py TestScaffold.test_policy_overwrite_template_content/original