@@ -617,31 +617,32 @@ def do_request(method, path, body=b""):
617617 resp_body = b""
618618 if method .upper () != "HEAD" and "Content-Length" in resp_headers :
619619 resp_body = proc .stdout .read (int (resp_headers ["Content-Length" ]))
620- return status , resp_body
620+ return status , resp_body , resp_headers
621621
622622 try :
623623 # 1. Create store
624- status , body = do_request ("POST" , "/?cmd=create" )
624+ status , body , headers = do_request ("POST" , "/?cmd=create" )
625625 assert status == 200
626626
627627 # 2. Store something
628628 item_data = b"stdio data"
629- status , body = do_request ("POST" , "/item1" , body = item_data )
629+ status , body , headers = do_request ("POST" , "/item1" , body = item_data )
630630 assert status == 200
631631
632632 # 3. List the store
633- status , body = do_request ("GET" , "/" )
633+ status , body , headers = do_request ("GET" , "/" )
634634 assert status == 200
635635 items = json .loads (body .decode ("utf-8" ))
636- assert any (item ["name" ] == "item1" for item in items )
636+ assert any (item ["name" ] == "item1" and item . get ( "atime" , 0 ) > 0 for item in items )
637637
638638 # 4. Info (HEAD)
639- status , body = do_request ("HEAD" , "/item1" )
639+ status , body , headers = do_request ("HEAD" , "/item1" )
640640 assert status == 200
641641 assert body == b""
642+ assert float (headers .get ("X-BorgStore-Atime" , 0 )) > 0
642643
643644 # 5. Info for nonexistent (HEAD)
644- status , body = do_request ("HEAD" , "/nonexistent" )
645+ status , body , headers = do_request ("HEAD" , "/nonexistent" )
645646 assert status == 404
646647 assert body == b""
647648
0 commit comments