@@ -1702,6 +1702,27 @@ def test_anonymous_protocol_download_for_running_experiment(self, client, queued
17021702 archive = zipfile .ZipFile (BytesIO (response .content ))
17031703 assert archive .filelist [0 ].filename == 'file1.txt'
17041704
1705+ @pytest .mark .parametrize ("entity_type,url_fragment" , [
1706+ ('model' , '/entities/models' ),
1707+ ('protocol' , '/entities/protocols' ),
1708+ ('fittingspec' , '/fitting/specs' ),
1709+ ])
1710+ def test_anonymous_entity_download_for_running_fittingresult (
1711+ self , client , queued_fittingresult , entity_type , url_fragment
1712+ ):
1713+ entity = getattr (queued_fittingresult .fittingresult , entity_type )
1714+ sha = entity .repo .latest_commit .sha
1715+ entity .set_version_visibility (sha , 'private' )
1716+
1717+ response = client .get (
1718+ '%s/%d/versions/latest/archive' % (url_fragment , entity .pk ),
1719+ HTTP_AUTHORIZATION = 'Token {}' .format (queued_fittingresult .signature )
1720+ )
1721+
1722+ assert response .status_code == 200
1723+ archive = zipfile .ZipFile (BytesIO (response .content ))
1724+ assert archive .filelist [0 ].filename == 'file1.txt'
1725+
17051726 def test_anonymous_protocol_download_for_analysis_task (self , client , analysis_task ):
17061727 protocol = analysis_task .entity
17071728 protocol .set_version_visibility ('latest' , 'private' )
0 commit comments