File size: 732 Bytes
db06ffa
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import tempfile
import unittest
from pathlib import Path

from zsgdp.config import load_config
from zsgdp.profiling import profile_document
from zsgdp.routing import route_document


class RoutingTests(unittest.TestCase):
    def test_markdown_routes_to_text_parser(self):
        with tempfile.TemporaryDirectory() as tmp:
            path = Path(tmp) / "sample.md"
            path.write_text("# Hello\n\nWorld", encoding="utf-8")
            profile = profile_document(path)
            decisions = route_document(profile, load_config())

        self.assertEqual(decisions[0].experts, ["text"])
        self.assertEqual(decisions[0].metadata["gpu_models_target"], "zeroshotGPU")


if __name__ == "__main__":
    unittest.main()