Merge lp://staging/~sinzui/juju-release-tools/upload-packges into lp://staging/juju-release-tools
Status: | Merged |
---|---|
Merged at revision: | 218 |
Proposed branch: | lp://staging/~sinzui/juju-release-tools/upload-packges |
Merge into: | lp://staging/juju-release-tools |
Diff against target: |
220 lines (+211/-0) 2 files modified
tests/test_upload_packages.py (+119/-0) upload_packages.py (+92/-0) |
To merge this branch: | bzr merge lp://staging/~sinzui/juju-release-tools/upload-packges |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Aaron Bentley (community) | Approve | ||
Review via email: mp+269250@code.staging.launchpad.net |
Description of the change
Upload source packages to Lp only when they are new.
This branch introduces a script that will dput source packages to a ppa if the archive doesn't have the source package. This script is a an old Lp test script I used to check if a source package is in an archive.
The only ssh-to-machine test in our releases is to do the dput. I didn't want to create a job that does an unchecked dput, because it can only be run once. This job can be run many times. if there is a network error while uploading, the job can be re-run to complete to dputs.
I intend to run this script like so
PACKAGE_
juju-
I want to solve the source package dir problem later (do not step into another job's workspace). This is more reliable that we have now.
The code looks reasonable. I have some style suggestions, especially in the tests.
I think you're using assert_called_with where you're expecting it to be called only once. I recommend assert_ called_ once_with instead.
In fact, I recommend avoiding assert_ called_ with(). I use: called_ once_with( 'foo')
# expecting 1 call
mock.assert_
# Expecting more than one call, but a specific pattern: l(mock. mock_calls, [call('foo'), call('bar')])
self.assertEqua
# Expecting no calls l(mock. call_count, 0)
self.assertEqua
You have a pattern where you create a Mock and assign one of its attributes to Mock(). I think this is not needed; it is the default.