Пример #1
0
    def test_bundle_install_components(self,
                                       bundle_install_plugin: Mock) -> None:
        manifest_path = os.path.join(os.path.dirname(__file__), "data",
                                     "opensearch-build-linux-1.1.0.yml")
        bundle = BundleOpenSearch(
            BuildManifest.from_path(manifest_path),
            os.path.join(os.path.dirname(__file__), "data", "artifacts"),
            MagicMock(),
        )

        bundle.install_components()
        self.assertEqual(bundle_install_plugin.call_count, 12)
Пример #2
0
 def test_bundle_include_common_utils(self, mock_path_isile: Mock,
                                      mock_check_call: Mock) -> None:
     manifest_path = os.path.join(os.path.dirname(__file__), "data",
                                  "opensearch-build-linux-1.1.0.yml")
     artifacts_path = os.path.join(os.path.dirname(__file__), "data",
                                   "artifacts")
     bundle_recorder = MagicMock()
     bundle = BundleOpenSearch(BuildManifest.from_path(manifest_path),
                               artifacts_path, bundle_recorder)
     with patch("shutil.copyfile"):
         bundle.install_components()
     bundle_recorder.record_component.assert_has_calls([
         call(bundle.components["OpenSearch"],
              "dist/opensearch-min-1.1.0-linux-x64.tar.gz"),
     ])
     bundle_recorder.record_component.assert_has_calls([
         call(bundle.components["common-utils"]),
         call(bundle.components["job-scheduler"],
              "plugins/opensearch-job-scheduler-1.1.0.0.zip"),
     ])
     mock_path_isile.assert_called()
     mock_check_call.assert_called()