Support SNI in python requests, and only delete tuf metadata if it

exists
This commit is contained in:
Evan Cordell 2017-05-01 15:51:54 -04:00
parent 02c4d75634
commit b2569ffbb2
6 changed files with 12 additions and 8 deletions

View file

@ -36,9 +36,10 @@ NOT_FOUND_RESPONSE = {
('invalid_req', False, INVALID_RESPONSE , 400),
])
def test_post_changetrust(trust_enabled, repo_found, expected_body, expected_status, client):
with patch('endpoints.api.repository.tuf_metadata_api'):
with patch('endpoints.api.repository.tuf_metadata_api') as mock_tuf:
with patch('endpoints.api.repository.model') as mock_model:
mock_model.repository.get_repository.return_value = MagicMock() if repo_found else None
mock_tuf.get_default_tags_with_expiration.return_value = ['tags', 'expiration']
with client_with_identity('devtable', client) as cl:
params = {'repository': 'devtable/repo'}
request_body = {'trust_enabled': trust_enabled}