Merge lp://staging/~sinzui/juju-ci-tools/storage-subset into lp://staging/juju-ci-tools

Proposed by Curtis Hovey
Status: Merged
Merged at revision: 1897
Proposed branch: lp://staging/~sinzui/juju-ci-tools/storage-subset
Merge into: lp://staging/juju-ci-tools
Diff against target: 120 lines (+66/-6)
2 files modified
assess_storage.py (+14/-6)
tests/test_assess_storage.py (+52/-0)
To merge this branch: bzr merge lp://staging/~sinzui/juju-ci-tools/storage-subset
Reviewer Review Type Date Requested Status
Aaron Bentley (community) Approve
Review via email: mp+317870@code.staging.launchpad.net

Description of the change

Assert that the expected storage info is a subset of info reported by Juju.

The assess_storage tests are broken because juju now shows additional information about filesystems and volumes. The failure is not surprising. I discussed the brittality of the storage tests when they were written -- even if we knew what Juju wanted to show, the substrate can make small changes that would break the test.

I created assert_dict_is_subset that will raise an error if any item in the sub/expected dict is not in the super dict. We don't care about extra items in the super dict.

To post a comment you must log in.
1899. By Curtis Hovey

remove unicode-ism.

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

Thanks for fixing this.

assert_dict_is_subset looks generally useful. But I think in the general case, we might want to recursively subset, so that if the subset is {'foo': {'bar': 'baz'}} the superset can be {'foo': {'bar': 'baz', 'qux': 'quxx'}}

review: Approve

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