File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -1403,6 +1403,14 @@ def test_copyfile_same_file(self):
1403
1403
# But Error should work too, to stay backward compatible.
1404
1404
self .assertRaises (Error , shutil .copyfile , src_file , src_file )
1405
1405
1406
+ def test_copy_w_different_length (self ):
1407
+ # copy and copy2 both accept an alternate buffer `length`
1408
+ for fn in (shutil .copy , shutil .copy2 ):
1409
+ with tempfile .NamedTemporaryFile () as src :
1410
+ with tempfile .NamedTemporaryFile () as dst :
1411
+ write_file (src .name , b'x' * 100 , binary = True )
1412
+ fn (src .name , dst .name , length = 20 )
1413
+
1406
1414
def test_copytree_return_value (self ):
1407
1415
# copytree returns its destination path.
1408
1416
src_dir = self .mkdtemp ()
@@ -1830,6 +1838,7 @@ def test_move_dir_caseinsensitive(self):
1830
1838
finally :
1831
1839
os .rmdir (dst_dir )
1832
1840
1841
+
1833
1842
class TermsizeTests (unittest .TestCase ):
1834
1843
def test_does_not_crash (self ):
1835
1844
"""Check if get_terminal_size() returns a meaningful value.
You can’t perform that action at this time.
0 commit comments