def __init__(self, build_store, build_spec, extra_env, virtuals, debug): self.build_store = build_store self.logger = getLogger('package', build_spec.doc['name']) self.build_spec = build_spec self.artifact_id = build_spec.artifact_id self.virtuals = virtuals self.extra_env = extra_env self.debug = debug
import unittest import os from os.path import join as pjoin from .. import profile from .. import package from hashdist.util.logger_setup import getLogger null_logger = getLogger('null_logger') class BaseStack(unittest.TestCase): def load_stack(self, dirpath, profile_name): """ Load stack and store profile and packagespecs in attributes """ profile_file = pjoin(os.path.dirname(__file__), 'test_stack', dirpath, profile_name) with profile.TemporarySourceCheckouts(None) as checkouts: doc = profile.load_and_inherit_profile(checkouts, profile_file) self.profile = profile.Profile(null_logger, doc, checkouts) for name in self.profile.packages: pkg = package.PackageSpec.load(self.profile, name) setattr(self, name, pkg) class TestUseAlternatePackage(BaseStack): def setUp(self): self.load_stack('use_alternate_package', 'profile.yaml') def test_profile(self): self.assertEqual(self.profile.packages['original'],
import unittest import os from os.path import join as pjoin from .. import profile from .. import package from hashdist.util.logger_setup import getLogger null_logger = getLogger("null_logger") class BaseStack(unittest.TestCase): def load_stack(self, dirpath, profile_name): """ Load stack and store profile and packagespecs in attributes """ profile_file = pjoin(os.path.dirname(__file__), "test_stack", dirpath, profile_name) with profile.TemporarySourceCheckouts(None) as checkouts: doc = profile.load_and_inherit_profile(checkouts, profile_file) self.profile = profile.Profile(null_logger, doc, checkouts) for name in self.profile.packages: pkg = package.PackageSpec.load(self.profile, name) setattr(self, name, pkg) class TestUseAlternatePackage(BaseStack): def setUp(self): self.load_stack("use_alternate_package", "profile.yaml") def test_profile(self): self.assertEqual(self.profile.packages["original"], {"use": "alternate"})
import unittest import os from os.path import join as pjoin from .. import profile from .. import package from hashdist.util.logger_setup import getLogger null_logger = getLogger('null_logger') class BaseStack(unittest.TestCase): def load_stack(self, dirpath, profile_name): """ Load stack and store profile and packagespecs in attributes """ profile_file = pjoin(os.path.dirname(__file__), 'test_stack', dirpath, profile_name) with profile.TemporarySourceCheckouts(None) as checkouts: doc = profile.load_and_inherit_profile(checkouts, profile_file) self.profile = profile.Profile(null_logger, doc, checkouts) for name in self.profile.packages: pkg = package.PackageSpec.load(self.profile, name) setattr(self, name, pkg) class TestUseAlternatePackage(BaseStack): def setUp(self): self.load_stack('use_alternate_package', 'profile.yaml') def test_profile(self):