@@ -531,9 +531,7 @@ def test_clean_lines():
531531data2
532532
533533 data3
534- """ .splitlines (
535- keepends = True
536- )
534+ """ .splitlines (keepends = True )
537535 assert list (clean_lines (conf )) == ["data1 #data1" , "data2" , "data3" ]
538536 assert list (clean_lines (conf , lstrip = False )) == ["data1 #data1" , "data2" , " data3" ]
539537 assert list (clean_lines (conf , rstrip = False )) == ["data1 #data1\n " , "data2\n " , "data3\n " ]
@@ -642,25 +640,27 @@ def test_valid_chunkerparams(chunker_params, expected_return):
642640def test_invalid_chunkerparams (invalid_chunker_params ):
643641 with pytest .raises (ArgumentTypeError ):
644642 ChunkerParams (invalid_chunker_params )
643+
644+
645645def test_files_cache_mode_win32_restriction (monkeypatch ):
646646 from borg .helpers import parseformat
647647 from borg .helpers .parseformat import FilesCacheMode , ArgumentTypeError
648648 import pytest
649649
650650 # 1. Simulate being on a Windows system
651- monkeypatch .setattr (parseformat , ' is_win32' , True )
652-
651+ monkeypatch .setattr (parseformat , " is_win32" , True )
652+
653653 # 2. Test that 'cis' (contains ctime) raises the error
654654 with pytest .raises (ArgumentTypeError , match = "ctime is not supported" ):
655655 FilesCacheMode ("cis" )
656-
656+
657657 # 3. Test that comma-separated 'ctime,size' also raises the error
658658 with pytest .raises (ArgumentTypeError , match = "ctime is not supported" ):
659659 FilesCacheMode ("ctime,size" )
660-
660+
661661 # 4. Ensure a non-ctime mode still works on 'Windows'
662662 assert FilesCacheMode ("ims" ) == "ims"
663663
664664 # 5. Switch back to non-Windows and ensure 'cis' works again
665- monkeypatch .setattr (parseformat , ' is_win32' , False )
666- assert FilesCacheMode ("cis" ) == "cis"
665+ monkeypatch .setattr (parseformat , " is_win32" , False )
666+ assert FilesCacheMode ("cis" ) == "cis"
0 commit comments