|
|
|
@@ -24,10 +24,7 @@ class TestCheckLearnware(unittest.TestCase): |
|
|
|
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) |
|
|
|
semantic_spec = self.client.get_semantic_specification(learnware_id) |
|
|
|
LearnwareClient.check_learnware(self.zip_path, semantic_spec) |
|
|
|
|
|
|
|
def test_check_learnware_conda(self): |
|
|
|
@@ -35,10 +32,7 @@ class TestCheckLearnware(unittest.TestCase): |
|
|
|
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) |
|
|
|
semantic_spec = self.client.get_semantic_specification(learnware_id) |
|
|
|
LearnwareClient.check_learnware(self.zip_path, semantic_spec) |
|
|
|
|
|
|
|
def test_check_learnware_dependency(self): |
|
|
|
@@ -46,10 +40,7 @@ class TestCheckLearnware(unittest.TestCase): |
|
|
|
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) |
|
|
|
semantic_spec = self.client.get_semantic_specification(learnware_id) |
|
|
|
LearnwareClient.check_learnware(self.zip_path, semantic_spec) |
|
|
|
|
|
|
|
def test_check_learnware_image(self): |
|
|
|
@@ -57,10 +48,7 @@ class TestCheckLearnware(unittest.TestCase): |
|
|
|
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) |
|
|
|
semantic_spec = self.client.get_semantic_specification(learnware_id) |
|
|
|
LearnwareClient.check_learnware(self.zip_path, semantic_spec) |
|
|
|
|
|
|
|
def test_check_learnware_text(self): |
|
|
|
@@ -68,10 +56,7 @@ class TestCheckLearnware(unittest.TestCase): |
|
|
|
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) |
|
|
|
semantic_spec = self.client.get_semantic_specification(learnware_id) |
|
|
|
LearnwareClient.check_learnware(self.zip_path, semantic_spec) |
|
|
|
|
|
|
|
|
|
|
|
|