HomeSoftware Heritage

Refactor BaseApiDepositClient to get rid of the _client argument

This commit no longer exists in the repository. It may have been part of a branch which was deleted.

Description

Refactor BaseApiDepositClient to get rid of the _client argument

This argument was only there to make it easier to mock the HTTP calls
(via a mocked requests). Thanks to the mockup capabilities, this is in
fact not necessary. So get rid of it and replace its usage in tests by
proper use of the mocker pytest fixture.

Also:

  • refactor this BaseApiDepositClient constructor to acces directly "url" and "auth" kwargs instead of an unspecified generic config dict (still supported but deprecated),
  • get rid of a few actually not really needed fixtures (deposit_config)
  • rewrite PrivateApiDepositClientStatusUpdateTest as a couple of pytest functions,
  • get rid of onliners functions in swh.deposit.cli.client (_client(), deposit_create, deposit_update).

Details

Provenance
douarddaAuthored on Nov 2 2020, 2:39 PM
douarddaPushed on Nov 10 2020, 6:42 PM
Differential Revision
D4431: Refactor BaseApiDepositClient to get rid of the _client argument
Build Status
Buildable 17017
Build 26262: test-and-buildJenkins console · Jenkins

Commit No Longer Exists

This commit no longer exists in the repository.