Merge lp://staging/~abentley/juju-release-tools/sync-command into lp://staging/juju-release-tools

Proposed by Aaron Bentley
Status: Merged
Merged at revision: 225
Proposed branch: lp://staging/~abentley/juju-release-tools/sync-command
Merge into: lp://staging/juju-release-tools
Diff against target: 440 lines (+317/-24)
3 files modified
azure_publish_tools.py (+27/-23)
tests/test_azure_publish_tools.py (+285/-1)
utils.py (+5/-0)
To merge this branch: bzr merge lp://staging/~abentley/juju-release-tools/sync-command
Reviewer Review Type Date Requested Status
Curtis Hovey (community) code Approve
Review via email: mp+274616@code.staging.launchpad.net

Commit message

Extract general-purpose functionality from fixed-prefix functionality.

Description of the change

This branch extracts general-purposed functionality from more-specialized functionality, with a view to eventually implementing a "sync" command.

It extracts get_local_sync_files and list_sync_files.
It adds unit tests to publish_files, get_local_files, get_published_files.

It also adds a blob_service parameter to all commands, since they all require one, and this makes it easier to supply a fake.

To post a comment you must log in.
Revision history for this message
Curtis Hovey (sinzui) wrote :

Thank you. I have a few comments, but nothing blocks you from merging.

review: Approve (code)
Revision history for this message
Aaron Bentley (abentley) wrote :

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

>> + def test_one_remote_file(self): + args =
>> Namespace(verbose=False, dry_run=False) + expected =
>> SyncFile( + 'index.json', 33, 'md5-asdf',
>> 'application/json', '') + service = FakeBlobService({ +
>> 'tools/index.json': FakeBlob.from_sync_file(expected) +
>> }) + with temp_dir() as local_dir: +
>> publish_files(service, RELEASED, local_dir, args)
>
> Is it pointless to assert that service.containers[JUJU_DIST] is
> unchanged, just {'tools/index.json':
> FakeBlob.from_sync_file(expected)}

No, that makes sense. I think I left this incomplete as I fleshed out
the fake.

Aaron
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQEcBAEBCAAGBQJWIAKuAAoJEK84cMOcf+9hB+MIAI8aLtpUnRxHca2LpPel2Bkr
GTBJwwTHHHcB+oWTwbKFDDX7g/LToz3NJ82kdV25x40lUD5t1h4dSDfpvNvtdrCU
Hu6VugBJjDw1ifTxivF3hfMQiEz4Gmg1Y6J1uBqB7M1PAkdojbIEVKLrKsqLQQEY
cSPqJkL5kbpADONtCI9J+WXrCm49DyG4OMPq/HpN4r/lfyIxFF42ANyjb5WkJ9U2
vS11NZvkXujT/04LikgG7O0Ha6xa/Q4Z9dMlYnltwgEmD2DQwwRSFHJJ0abSGK2z
JRPNmrviwjC+o263xJFzPMXP12ZSwnbZoFifsZxfvYMAOo/9ydmGoGIeONi+jb0=
=jDKH
-----END PGP SIGNATURE-----

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches