Spaces:
Build error
Build error
Download tests/test_extractor.py from Hztech/passport-static: direct link, hf CLI and curl.
- Browser
- Download file 680 Bytes
-
https://huggingface.co/spaces/Hztech/passport-static/resolve/main/tests/test_extractor.py
- Command line
-
hf download hf://spaces/Hztech/passport-static/tests/test_extractor.py
-
curl -L -o test_extractor.py https://huggingface.co/spaces/Hztech/passport-static/resolve/main/tests/test_extractor.py
680 Bytes
| import unittest | |
| import os | |
| from src.extractor import PassportExtractor | |
| class TestPassportExtractor(unittest.TestCase): | |
| def test_initialization(self): | |
| """Test if the extractor can be initialized.""" | |
| try: | |
| extractor = PassportExtractor(use_gpu=False) | |
| self.assertIsNotNone(extractor.reader) | |
| except Exception as e: | |
| self.fail(f"Initialization failed: {e}") | |
| def test_utils_import(self): | |
| """Test if utils can be imported correctly.""" | |
| from src.utils import clean_string | |
| self.assertEqual(clean_string("Hello 123!"), "HELLO123") | |
| if __name__ == '__main__': | |
| unittest.main() | |