1515
1616import pytest
1717
18+ from tests .test_spec_fixtures import get_all_decode_fixtures
1819from toon_format import ToonDecodeError , decode , encode
1920from toon_format .types import DecodeOptions , EncodeOptions
20- from tests .test_spec_fixtures import get_all_decode_fixtures
2121
2222
2323class TestEncodeAPI :
@@ -293,38 +293,43 @@ def test_roundtrip_with_length_marker(self):
293293
294294
295295# TODO: Add targeted unit tests for decode()'s json_indent feature here.
296- # See Issue #10. For now, comprehensive tests are in TestDecodeJSONIndentationWithSpecFixtures.
297- @pytest .mark .skip (reason = "Placeholder for targeted decode() JSON indentation tests. See TODO above." )
296+ # See Issue #10. For now, comprehensive tests are in
297+ # TestDecodeJSONIndentationWithSpecFixtures.
298+ @pytest .mark .skip (
299+ reason = "Placeholder for targeted decode() JSON indentation tests. See TODO above."
300+ )
298301class TestDecodeJSONIndentation :
299302 """Test decode() JSON indentation feature (Issue #10).
300-
301- Comprehensive tests for the json_indent feature are in TestDecodeJSONIndentationWithSpecFixtures,
302- which validates against official TOON specification fixtures.
303+
304+ Comprehensive tests for the json_indent feature are in
305+ TestDecodeJSONIndentationWithSpecFixtures, which validates against official
306+ TOON specification fixtures.
303307 """
308+
304309 pass
305310
306311
307312def _get_sample_decode_fixtures () -> List [tuple ]:
308313 """Get a sample of decode test cases from fixture files for json_indent testing.
309-
314+
310315 Selects a few representative test cases from the official TOON spec fixtures.
311316 """
312317 all_fixtures = get_all_decode_fixtures ()
313-
318+
314319 # Select a few representative test cases from different fixture categories
315320 selected_files = {"primitives.json" , "arrays-primitive.json" , "objects.json" }
316321 test_cases = []
317-
322+
318323 for test_id , test_data , fixture_name in all_fixtures :
319324 if f"{ fixture_name } .json" in selected_files and len (test_cases ) < 9 :
320325 test_cases .append ((test_id , test_data ))
321-
326+
322327 return test_cases
323328
324329
325330class TestDecodeJSONIndentationWithSpecFixtures :
326331 """Test json_indent feature against spec fixtures to ensure comprehensive coverage.
327-
332+
328333 These tests validate that the json_indent feature works correctly with various
329334 TOON format patterns defined in the official specification fixtures.
330335 """
@@ -358,9 +363,7 @@ def test_json_indent_produces_valid_json(self, test_id: str, test_data: Dict[str
358363 )
359364
360365 @pytest .mark .parametrize ("test_id,test_data" , _get_sample_decode_fixtures ())
361- def test_json_indent_with_different_indent_sizes (
362- self , test_id : str , test_data : Dict [str , Any ]
363- ):
366+ def test_json_indent_with_different_indent_sizes (self , test_id : str , test_data : Dict [str , Any ]):
364367 """Verify that json_indent respects different indent sizes."""
365368 input_str = test_data ["input" ]
366369 expected = test_data .get ("expected" )
@@ -384,7 +387,9 @@ def test_json_indent_with_different_indent_sizes(
384387 if "\n " in result_2 and "\n " in result_4 :
385388 # Multi-line results should differ in formatting
386389 # (indentation characters will be different)
387- assert result_2 != result_4 , "Different indent sizes should produce different formatting"
390+ assert result_2 != result_4 , (
391+ "Different indent sizes should produce different formatting"
392+ )
388393
389394 def test_json_indent_consistency_with_plain_decode (self ):
390395 """Verify that json_indent=None produces same data as plain decode."""
0 commit comments