~abentley/bzrtools/bzrtools.dev

« back to all changes in this revision

Viewing changes to blackbox.py

  • Committer: Aaron Bentley
  • Date: 2005-10-24 04:07:55 UTC
  • Revision ID: aaron.bentley@utoronto.ca-20051024040755-2b574c6aff8ac6d2
Added blackbox tests for bzrtools

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
from bzrlib.selftest.blackbox import ExternalBase
 
2
from unittest import makeSuite
 
3
import os.path
 
4
class TestBzrTools(ExternalBase):
 
5
    @staticmethod
 
6
    def touch(filename):
 
7
        file(filename, 'wb').write('')
 
8
 
 
9
    def test_clean_tree(self):
 
10
        self.runbzr('init')
 
11
        self.touch('name')
 
12
        self.touch('name~')
 
13
        assert os.path.lexists('name~')
 
14
        self.touch('name.pyc')
 
15
        self.runbzr('clean-tree')
 
16
        assert os.path.lexists('name~')
 
17
        assert not os.path.lexists('name')
 
18
        self.runbzr('clean-tree --detrius')
 
19
        assert not os.path.lexists('name~')
 
20
        assert os.path.lexists('name.pyc')
 
21
        self.runbzr('clean-tree --ignored')
 
22
        assert not os.path.lexists('name.pyc')
 
23
 
 
24
    def test_shelve(self):
 
25
        self.runbzr('init')
 
26
        self.runbzr('commit -m uc --unchanged')
 
27
        self.runbzr('shelve -r 1 -m foo', retcode=1)
 
28
 
 
29
def test_suite():
 
30
    return makeSuite(TestBzrTools)