File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -383,6 +383,24 @@ def test_pfop(self):
383383 assert ret ['persistentId' ] is not None
384384
385385
386+ class EtagTestCase (unittest .TestCase ):
387+ def test_zero_size (self ):
388+ open ("x" , 'a' ).close ()
389+ hash = etag ("x" )
390+ assert hash == 'Fto5o-5ea0sNMlW_75VgGJCv2AcJ'
391+ remove_temp_file ("x" )
392+ def test_small_size (self ):
393+ localfile = create_temp_file (1024 * 1024 )
394+ hash = etag (localfile )
395+ assert hash == 'FnlAdmDasGTQOIgrU1QIZaGDv_1D'
396+ remove_temp_file (localfile )
397+ def test_large_size (self ):
398+ localfile = create_temp_file (4 * 1024 * 1024 + 1 )
399+ hash = etag (localfile )
400+ assert hash == 'ljF323utglY3GI6AvLgawSJ4_dgk'
401+ remove_temp_file (localfile )
402+
403+
386404class ReadWithoutSeek (object ):
387405 def __init__ (self , str ):
388406 self .str = str
You can’t perform that action at this time.
0 commit comments