~abentley/bzrtools/bzrtools.dev

« back to all changes in this revision

Viewing changes to tests/clean_tree.py

  • Committer: Aaron Bentley
  • Date: 2007-02-15 20:02:58 UTC
  • Revision ID: abentley@panoramicfeedback.com-20070215200258-w08yzl5tz9wiuxtu
Fix imports

Show diffs side-by-side

added added

removed removed

Lines of Context:
50
50
        finally:
51
51
            f.close()
52
52
        file('branch/file.BASE', 'wb').write('contents')
53
 
        tree.lock_write()
54
 
        try:
55
 
            self.assertEqual(len(list(iter_deletables(tree, unknown=True))), 1)
56
 
            file('branch/file', 'wb').write('contents')
57
 
            file('branch/file~', 'wb').write('contents')
58
 
            file('branch/file.pyc', 'wb').write('contents')
59
 
 
60
 
            dels = sorted([r for a,r in iter_deletables(tree, unknown=True)])
61
 
            assert sorted(['file', 'file.BASE']) == dels
62
 
 
63
 
            dels = [r for a,r in iter_deletables(tree, detritus=True)]
64
 
            assert sorted(['file~', 'file.BASE']) == dels
65
 
 
66
 
            dels = [r for a,r in iter_deletables(tree, ignored=True)]
67
 
            assert sorted(['file~', 'file.pyc', '.bzrignore']) == dels
68
 
 
69
 
            dels = [r for a,r in iter_deletables(tree, unknown=False)]
70
 
            assert [] == dels
71
 
        finally:
72
 
            tree.unlock()
 
53
        self.assertEqual(len(list(iter_deletables(tree, unknown=True))), 1)
 
54
        file('branch/file', 'wb').write('contents')
 
55
        file('branch/file~', 'wb').write('contents')
 
56
        file('branch/file.pyc', 'wb').write('contents')
 
57
 
 
58
        dels = sorted([r for a,r in iter_deletables(tree, unknown=True)])
 
59
        assert sorted(['file', 'file.BASE']) == dels
 
60
 
 
61
        dels = [r for a,r in iter_deletables(tree, detritus=True)]
 
62
        assert sorted(['file~', 'file.BASE']) == dels
 
63
 
 
64
        dels = [r for a,r in iter_deletables(tree, ignored=True)]
 
65
        assert sorted(['file~', 'file.pyc', '.bzrignore']) == dels
 
66
 
 
67
        dels = [r for a,r in iter_deletables(tree, unknown=False)]
 
68
        assert [] == dels
73
69
 
74
70
def test_suite():
75
71
    return makeSuite(TestCleanTree)