def test_chart_source_clone(self, mock_os, mock_dot): from supermutes.dot import dotify import yaml mock_dot.dotify.return_value = dotify(yaml.load(self.chart_stream)) mock_os.path.join.return_value = self.chart_stream ChartBuilder.source_clone = mock.Mock(return_value='path') chartbuilder = ChartBuilder(self.chart_stream) resp = chartbuilder.get_metadata() self.assertIsNotNone(resp) self.assertIsInstance(resp, basestring)
def test_source_clone(self): # Create a temporary directory with Chart.yaml that contains data # from ``self.chart_yaml``. chart_dir = self.useFixture(fixtures.TempDir()) self.addCleanup(shutil.rmtree, chart_dir.path) self._write_temporary_file_contents(chart_dir.path, 'Chart.yaml', self.chart_yaml) chartbuilder = ChartBuilder(self._get_test_chart(chart_dir)) # Validate response type is :class:`hapi.chart.metadata_pb2.Metadata` resp = chartbuilder.get_metadata() self.assertIsInstance(resp, Metadata)