def setUp(self): self.workdir = C.setup_workdir() self.tpaths = [C.selfdir(), self.workdir]
# This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. # import miniascape.template as TT import miniascape.tests.common as C import anyconfig as A import os.path import unittest _CONFFILE_0 = os.path.join(C.selfdir(), "00_sample.yml") _TMPL_0 = "00_sample.tmpl" class Test_00_effectful_functions(unittest.TestCase): def setUp(self): self.workdir = C.setup_workdir() self.tpaths = [C.selfdir(), self.workdir] def tearDown(self): C.cleanup_workdir(self.workdir) def test_10_render_to(self): ctx = A.load(_CONFFILE_0) tmpl = _TMPL_0 output = os.path.join(self.workdir, "tmpl.out")
# but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. # import miniascape.template as TT import miniascape.tests.common as C import anyconfig as A import os.path import unittest _CONFFILE_0 = os.path.join(C.selfdir(), "00_sample.yml") _TMPL_0 = "00_sample.tmpl" class Test_00_effectful_functions(unittest.TestCase): def setUp(self): self.workdir = C.setup_workdir() self.tpaths = [C.selfdir(), self.workdir] def tearDown(self): C.cleanup_workdir(self.workdir) def test_10_render_to(self): ctx = A.load(_CONFFILE_0) tmpl = _TMPL_0
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. # import miniascape.site as TT import miniascape.tests.common as C import anyconfig import logging import os.path import unittest PKGDIR = os.path.join(C.selfdir(), "..", "..") CTXS = [os.path.join(PKGDIR, "conf/default", "*.yml")] TMPLDIR = os.path.join(PKGDIR, "templates") # Suppress verbose logging messages from anyconfig. anyconfig.set_loglevel(logging.WARN) class Test_00_effectful_functions(unittest.TestCase): def setUp(self): self.workdir = C.setup_workdir() def tearDown(self): C.cleanup_workdir(self.workdir)
# # Copyright (C) 2014 Satoru SATOH <*****@*****.**> # License: GPLv3+ # import miniascape.bootstrap as TT import miniascape.utils as U import miniascape.tests.common as C import os.path import unittest TOPDIR = os.path.join(C.selfdir(), "..", "..") class Test_00_functions(unittest.TestCase): def setUp(self): self.workdir = C.setup_workdir() def tearDown(self): # C.cleanup_workdir(self.workdir) pass def test_10_bootstrap(self): site = "site-A" TT.bootstrap(site, self.workdir, site_template="rhui", site_ctxdir=os.path.join(TOPDIR, "conf"), tpaths=[os.path.join(TOPDIR, "templates")]) sitedir = os.path.join(self.workdir, site)