Esempio n. 1
0
    def test_recursive_render(self):
        tmpdir = tempfile.mkdtemp()
        try:
            recursive_render(os.path.join(os.path.dirname(__file__),
                                          'test_data', 'recursive_render'),
                             tmpdir, {'var': 'resolvedvar'})
            self.assertFalse(os.path.exists(os.path.join(tmpdir, 'foo', 'bar', '.baz.swp')))

            with open(os.path.join(tmpdir, 'foo', 'bar', 'baz'), 'r') as fp:
                self.assertEquals('resolvedvar\n', fp.read())

            with open(os.path.join(tmpdir, 'wibble'), 'r') as fp:
                self.assertEquals('wobble\n', fp.read())
        finally:
            shutil.rmtree(tmpdir)
Esempio n. 2
0
    def test_recursive_render(self):
        tmpdir = tempfile.mkdtemp()
        try:
            recursive_render(
                os.path.join(os.path.dirname(__file__), 'test_data',
                             'recursive_render'), tmpdir,
                {'var': 'resolvedvar'})
            self.assertFalse(
                os.path.exists(os.path.join(tmpdir, 'foo', 'bar', '.baz.swp')))

            with open(os.path.join(tmpdir, 'foo', 'bar', 'baz'), 'r') as fp:
                self.assertEquals('resolvedvar\n', fp.read())

            with open(os.path.join(tmpdir, 'wibble'), 'r') as fp:
                self.assertEquals('wobble\n', fp.read())
        finally:
            shutil.rmtree(tmpdir)
 def ensure_directory_structure(self):
     tmpl_dir = os.path.abspath(os.path.join(os.path.dirname(__file__),
                                'templates/buildsvc/reprepro'))
     recursive_render(tmpl_dir, self.basedir, {'repository': self.repository})
Esempio n. 4
0
 def ensure_directory_structure(self):
     tmpl_dir = os.path.abspath(
         os.path.join(os.path.dirname(__file__),
                      'templates/buildsvc/reprepro'))
     recursive_render(tmpl_dir, self.basedir,
                      {'repository': self.repository})