-
Notifications
You must be signed in to change notification settings - Fork 68
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Skeleton for metadata service (#398)
Summary: Pull Request resolved: #398 This will be used to upload and host checksum data for now, and could be extended to hosting other data in the future. Differential Revision: D38516464 fbshipit-source-id: d239af1ebae21856c2fb800b81224e7f32a2d814
- Loading branch information
1 parent
3e84a68
commit 0a1d841
Showing
4 changed files
with
91 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#!/usr/bin/env python3 | ||
# Copyright (c) Meta Platforms, Inc. and affiliates. | ||
# | ||
# This source code is licensed under the MIT license found in the | ||
# LICENSE file in the root directory of this source tree. | ||
|
||
from typing import Any, Dict | ||
|
||
from fbpcp.service.storage import StorageService | ||
from onedocker.entity.object_metadata import PackageMetadata | ||
|
||
|
||
class OneDockerMetadataService: | ||
def __init__( | ||
self, | ||
storage_svc: StorageService, | ||
) -> None: | ||
self.storage_svc = storage_svc | ||
|
||
def set_metadata(self, package_path: str, metadata_dict: Dict[Any, Any]) -> None: | ||
raise NotImplementedError | ||
|
||
def get_metadata(self, package_path: str) -> PackageMetadata: | ||
raise NotImplementedError |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
onedocker/tests/repository/test_onedocker_metadata_service.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#!/usr/bin/env python3 | ||
# Copyright (c) Meta Platforms, Inc. and affiliates. | ||
# | ||
# This source code is licensed under the MIT license found in the | ||
# LICENSE file in the root directory of this source tree. | ||
|
||
|
||
import unittest | ||
from unittest.mock import patch | ||
|
||
from onedocker.repository.onedocker_metadata_service import OneDockerMetadataService | ||
|
||
|
||
class TestOneDockerMetadataService(unittest.TestCase): | ||
@patch("onedocker.repository.onedocker_metadata_service.StorageService") | ||
def setUp(self, mockStorageService): | ||
self.metadata_svc = OneDockerMetadataService(mockStorageService) | ||
|
||
def test_set_metadata(self): | ||
pass | ||
|
||
def test_get_metadata(self): | ||
pass |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters