@@ -1617,6 +1617,27 @@ def test_info(self):
16171617        info_archive  =  self .cmd ('info' , '--first' , '1' , self .repository_location )
16181618        assert  'Archive name: test\n '  in  info_archive 
16191619
1620+     def  test_info_matches_create_deduplicated_size (self ):
1621+         # Create two identical files to ensure intra-archive deduplication happens, 
1622+         # so the deduplicated size is visibly different from compressed size. 
1623+         data  =  b'X'  *  (1024  *  80 )
1624+         self .create_regular_file ('file1' , contents = data )
1625+         self .create_regular_file ('file2' , contents = data )
1626+         self .cmd ('init' , '--encryption=repokey' , self .repository_location )
1627+         create_out  =  self .cmd ('create' , '--stats' , self .repository_location  +  '::test' , 'input' )
1628+         info_out  =  self .cmd ('info' , self .repository_location  +  '::test' )
1629+ 
1630+         import  re 
1631+ 
1632+         def  get_dedup (s ):
1633+             m  =  re .search (r'^This archive:\s+(.*?)\s+(.*?)\s+(.+)$' , s , re .M )
1634+             assert  m  is  not   None , s 
1635+             return  m .group (3 ).strip ()
1636+ 
1637+         dedup_create  =  get_dedup (create_out )
1638+         dedup_info  =  get_dedup (info_out )
1639+         assert  dedup_create  ==  dedup_info 
1640+ 
16201641    def  test_info_json (self ):
16211642        self .create_regular_file ('file1' , size = 1024  *  80 )
16221643        self .cmd ('init' , '--encryption=repokey' , self .repository_location )
0 commit comments