def test_inject_dependencies(self): dependencies = { 'DependencyA': { 'version': 'vA' }, 'DependencyB': { 'version': 'vB' } } fd, path = tempfile.mkstemp(prefix='bomdeps') os.close(fd) with open(path, 'w') as stream: yaml.dump(dependencies, stream) options = self.options options.bom_dependencies_path = path try: builder = BomBuilder(options, self.scm) bom = builder.build() finally: os.remove(path) self.assertEquals(dependencies, bom['dependencies']) self.assertEquals({}, bom['services'])
def test_inject_dependencies(self): dependencies = { "DependencyA": { "version": "vA" }, "DependencyB": { "version": "vB" }, } fd, path = tempfile.mkstemp(prefix="bomdeps") os.close(fd) with open(path, "w") as stream: yaml.safe_dump(dependencies, stream) options = self.options options.bom_dependencies_path = path try: builder = BomBuilder(options, self.scm, MetricsManager.singleton()) bom = builder.build() finally: os.remove(path) self.assertEqual(dependencies, bom["dependencies"]) self.assertEqual({}, bom["services"])
def test_default_build(self): builder = BomBuilder(self.options, self.scm) bom = builder.build() self.assertEquals(bom['dependencies'], load_default_bom_dependencies()) # There are no services because we never added any. # Although the builder takes an SCM, you still need to explicitly add repos. self.assertEquals({}, bom['services'])
def test_default_build(self): builder = BomBuilder(self.options, self.scm, MetricsManager.singleton()) bom = builder.build() self.assertEqual(bom["dependencies"], load_default_bom_dependencies()) # There are no services because we never added any. # Although the builder takes an SCM, you still need to explicitly add repos. self.assertEqual({}, bom["services"])
def test_default_build(self): builder = BomBuilder(self.options, self.scm, MetricsManager.singleton()) bom = builder.build() self.assertEqual( bom['dependencies'], load_default_bom_dependencies()) # There are no services because we never added any. # Although the builder takes an SCM, you still need to explicitly add repos. self.assertEqual({}, bom['services'])
def test_inject_dependencies(self): dependencies = { 'DependencyA': {'version': 'vA'}, 'DependencyB': {'version': 'vB'} } fd, path = tempfile.mkstemp(prefix='bomdeps') os.close(fd) with open(path, 'w') as stream: yaml.safe_dump(dependencies, stream) options = self.options options.bom_dependencies_path = path try: builder = BomBuilder(options, self.scm, MetricsManager.singleton()) bom = builder.build() finally: os.remove(path) self.assertEqual(dependencies, bom['dependencies']) self.assertEqual({}, bom['services'])