~jml/treeshape/matchers

« back to all changes in this revision

Viewing changes to treeshape/tests/test_matchers.py

  • Committer: Jonathan Lange
  • Date: 2012-08-07 15:59:55 UTC
  • Revision ID: jml@canonical.com-20120807155955-l3qo29uvn5bnsyzj
Add HasFileTree matcher

Show diffs side-by-side

added added

removed removed

Lines of Context:
25
25
    CONTENT,
26
26
    FileTree,
27
27
    from_rough_spec,
 
28
    HasFileTree,
28
29
    MatchesFileTree,
29
30
    PERMISSIONS,
30
31
    )
143
144
            'bar/',
144
145
            ]
145
146
        self.assertThat(path, MatchesFileTree(from_rough_spec(expected)))
 
147
 
 
148
 
 
149
class TestHasFileTree(TestCase):
 
150
 
 
151
    def test_unexpected_file(self):
 
152
        path = self.useFixture(FileTree({'foo': {}, 'bar': {}})).path
 
153
        self.assertThat(path, HasFileTree({'bar': {}}))