You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

test_check_learnware.py 766 B

123456789101112131415161718192021222324252627
  1. import os
  2. import unittest
  3. import tempfile
  4. from learnware.client import LearnwareClient
  5. class TestCheckLearnware(unittest.TestCase):
  6. def setUp(self):
  7. unittest.TestCase.setUpClass()
  8. email = "liujd@lamda.nju.edu.cn"
  9. token = "f7e647146a314c6e8b4e2e1079c4bca4"
  10. self.client = LearnwareClient()
  11. self.client.login(email, token)
  12. self.learnware_id = "00000154"
  13. def test_check_learnware(self):
  14. with tempfile.TemporaryDirectory(prefix="learnware_") as tempdir:
  15. self.zip_path = os.path.join(tempdir, "test.zip")
  16. self.client.download_learnware(self.learnware_id, self.zip_path)
  17. LearnwareClient.check_learnware(self.zip_path)
  18. if __name__ == "__main__":
  19. unittest.main()