Update unit tests for download.py, repository_lib.py, repository_tool.py, and updater.py.
Re-generate repository data so that compressed metadata may be tested.
Add test_formats_rsakey_from_pem() test case and test conditions for improperly formatted PEM.
Add test condition to verify trailing whitespace is removed and matches the expected PEM format generated
internally. Public PEMs generated externally (with the expected trailing newline) was not previously considered.
A few test conditions in test_updater.py incorrectly used self.assertTrue() instead of self.assertEqual().
Fix updater.remove_obsolete_targets(), where targets in the destination directory were not being removed because target paths were treated as absolute paths by os.path.join().
Fix test conditions for updated_targets(), which incorrectly verified the expected number of updated targets with assertTrue().
Update comment for PR fix to clarify os.path.join() behavior and the expected file paths.
The updater client may reference target information (including 'custom') by accessing the dictionary returned by updater.py.
Example:
target = updater.target('LICENSE.txt')
target['filepath']
target['fileinfo']['length']
target['fileinfo']['hashes']
target['fileinfo']['custom']
After seeing the coveralls report I realized the projects were not
relocatable. While this might be convenient for some uses, moving a
project from one place to another might not be optimal. This has been
changed now.
The only place where absolute filepaths are handled now is with flat
project layouts. However, it is possible to overwrite this filepath if
the targets folder is to be changed.
The generate_repository_data script works in the exact same way as the
generate script and it generates a fresh batch of pre-signed metadata to
test the load_project function.
Added two switches to the generate script:
-k (or --keys), which forces the creation of new keys.
-d (or --dry-run), which skips the actual writing or copying phases
The second option might be useful in the future, and helped me debug the
optparse module, so I left it there.