Browse Source

[FIX] fix details to fit with BaseUserInfo

tags/v0.3.2
Gene 2 years ago
parent
commit
87bb9c614c
1 changed files with 4 additions and 10 deletions
  1. +4
    -10
      tests/test_learnware_client/test_all_learnware.py

+ 4
- 10
tests/test_learnware_client/test_all_learnware.py View File

@@ -6,6 +6,7 @@ import tempfile

from learnware.client import LearnwareClient
from learnware.specification import Specification
from learnware.market import BaseUserInfo


class TestAllLearnware(unittest.TestCase):
@@ -30,16 +31,9 @@ class TestAllLearnware(unittest.TestCase):

def test_all_learnware(self):
max_learnware_num = 1000
semantic_spec = dict()
semantic_spec["Data"] = {"Type": "Class", "Values": []}
semantic_spec["Task"] = {"Type": "Class", "Values": []}
semantic_spec["Library"] = {"Type": "Class", "Values": []}
semantic_spec["Scenario"] = {"Type": "Tag", "Values": []}
semantic_spec["Name"] = {"Type": "String", "Values": ""}
semantic_spec["Description"] = {"Type": "String", "Values": ""}

specification = Specification(semantic_spec=semantic_spec)
result = self.client.search_learnware(specification, page_size=max_learnware_num)
semantic_spec = self.client.create_semantic_specification()
user_info = BaseUserInfo(semantic_spec=semantic_spec, stat_info={})
result = self.client.search_learnware(user_info, page_size=max_learnware_num)
print(f"result size: {len(result)}")
print(f"key in result: {[key for key in result[0]]}")



Loading…
Cancel
Save