@@ -36,14 +36,11 @@ def test_data_source_info_dict_returns_raw_data(self):
3636 "data_source_type" : "website_crawl" ,
3737 "data_source_info" : json .dumps ({"url" : "https://example.com" , "job_id" : "job-789" }),
3838 "expected_raw" : {"url" : "https://example.com" , "job_id" : "job-789" },
39- }
39+ },
4040 ]
4141
4242 for case in test_cases :
43- document = Document (
44- data_source_type = case ["data_source_type" ],
45- data_source_info = case ["data_source_info" ]
46- )
43+ document = Document (data_source_type = case ["data_source_type" ], data_source_info = case ["data_source_info" ])
4744
4845 # Test data_source_info_dict (raw data)
4946 raw_result = document .data_source_info_dict
@@ -54,16 +51,9 @@ def test_data_source_info_dict_returns_raw_data(self):
5451
5552 def test_local_file_data_source_info_without_db_context (self ):
5653 """Test that local_file type data_source_info_dict works without database context."""
57- test_data = {
58- "file_path" : "/local/path/document.txt" ,
59- "size" : 512 ,
60- "created_at" : "2024-01-01T00:00:00Z"
61- }
54+ test_data = {"file_path" : "/local/path/document.txt" , "size" : 512 , "created_at" : "2024-01-01T00:00:00Z" }
6255
63- document = Document (
64- data_source_type = "local_file" ,
65- data_source_info = json .dumps (test_data )
66- )
56+ document = Document (data_source_type = "local_file" , data_source_info = json .dumps (test_data ))
6757
6858 # data_source_info_dict should return the raw data (this doesn't need DB context)
6959 raw_data = document .data_source_info_dict
@@ -78,21 +68,15 @@ def test_notion_and_website_crawl_data_source_detail(self):
7868 """Test that notion_import and website_crawl return raw data in data_source_detail_dict."""
7969 # Test notion_import
8070 notion_data = {"notion_page_id" : "page-123" , "workspace_id" : "ws-456" }
81- document = Document (
82- data_source_type = "notion_import" ,
83- data_source_info = json .dumps (notion_data )
84- )
71+ document = Document (data_source_type = "notion_import" , data_source_info = json .dumps (notion_data ))
8572
8673 # data_source_detail_dict should return raw data for notion_import
8774 detail_result = document .data_source_detail_dict
8875 assert detail_result == notion_data
8976
9077 # Test website_crawl
9178 website_data = {"url" : "https://example.com" , "job_id" : "job-789" }
92- document = Document (
93- data_source_type = "website_crawl" ,
94- data_source_info = json .dumps (website_data )
95- )
79+ document = Document (data_source_type = "website_crawl" , data_source_info = json .dumps (website_data ))
9680
9781 # data_source_detail_dict should return raw data for website_crawl
9882 detail_result = document .data_source_detail_dict
@@ -101,10 +85,7 @@ def test_notion_and_website_crawl_data_source_detail(self):
10185 def test_local_file_data_source_detail_dict_without_db (self ):
10286 """Test that local_file returns empty data_source_detail_dict (this doesn't need DB context)."""
10387 # Test local_file - this should work without database context since it returns {} early
104- document = Document (
105- data_source_type = "local_file" ,
106- data_source_info = json .dumps ({"file_path" : "/tmp/test.txt" })
107- )
88+ document = Document (data_source_type = "local_file" , data_source_info = json .dumps ({"file_path" : "/tmp/test.txt" }))
10889
10990 # Should return empty dict for local_file type (handled in the model)
11091 detail_result = document .data_source_detail_dict
0 commit comments