def test_write_manifest(self, mock_create_manifest, mock_makedirs): input_manifests = InputManifests("test") input_manifests.write_manifest('0.1.2', []) mock_create_manifest.assert_called_with('0.1.2', []) mock_makedirs.assert_called_with(os.path.join( InputManifests.manifests_path(), '0.1.2'), exist_ok=True) mock_create_manifest.return_value.to_file.assert_called_with( os.path.join(InputManifests.manifests_path(), '0.1.2', 'test-0.1.2.yml'))
def test_write_manifest(self, mock_create_manifest: MagicMock, mock_makedirs: MagicMock) -> None: input_manifests = InputManifests("opensearch") input_manifests.write_manifest('0.1.2', []) mock_create_manifest.assert_called_with('0.1.2', []) mock_makedirs.assert_called_with(os.path.join( InputManifests.manifests_path(), '0.1.2'), exist_ok=True) mock_create_manifest.return_value.to_file.assert_called_with( os.path.join(InputManifests.manifests_path(), '0.1.2', 'opensearch-0.1.2.yml'))
def test_manifests_path(self): path = os.path.realpath( os.path.join(os.path.dirname(__file__), "..", "..", "manifests")) self.assertEqual(path, InputManifests.manifests_path())