|
|
|
@@ -46,16 +46,16 @@ class TestCheckLearnware(unittest.TestCase): |
|
|
|
semantic_spec = json.load(json_file) |
|
|
|
LearnwareClient.check_learnware(self.zip_path, semantic_spec) |
|
|
|
|
|
|
|
def test_check_learnware_image(self): |
|
|
|
learnware_id = "00000677" |
|
|
|
with tempfile.TemporaryDirectory(prefix="learnware_") as tempdir: |
|
|
|
self.zip_path = os.path.join(tempdir, "test.zip") |
|
|
|
self.client.download_learnware(learnware_id, self.zip_path) |
|
|
|
|
|
|
|
with zipfile.ZipFile(self.zip_path, "r") as zip_file: |
|
|
|
with zip_file.open("semantic_specification.json") as json_file: |
|
|
|
semantic_spec = json.load(json_file) |
|
|
|
LearnwareClient.check_learnware(self.zip_path, semantic_spec) |
|
|
|
# def test_check_learnware_image(self): |
|
|
|
# learnware_id = "00000677" |
|
|
|
# with tempfile.TemporaryDirectory(prefix="learnware_") as tempdir: |
|
|
|
# self.zip_path = os.path.join(tempdir, "test.zip") |
|
|
|
# self.client.download_learnware(learnware_id, self.zip_path) |
|
|
|
|
|
|
|
# with zipfile.ZipFile(self.zip_path, "r") as zip_file: |
|
|
|
# with zip_file.open("semantic_specification.json") as json_file: |
|
|
|
# semantic_spec = json.load(json_file) |
|
|
|
# LearnwareClient.check_learnware(self.zip_path, semantic_spec) |
|
|
|
|
|
|
|
def test_check_learnware_text(self): |
|
|
|
learnware_id = "00000662" |
|
|
|
|