/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/tests/blackbox/test_revert.py

  • Committer: Andrew Bennetts
  • Date: 2008-08-12 14:53:26 UTC
  • mto: This revision was merged to the branch mainline in revision 3624.
  • Revision ID: andrew.bennetts@canonical.com-20080812145326-yx693x2jc4rcovb7
Move the notes on writing tests out of HACKING into a new file, and improve
them.

Many of the testing notes in the HACKING file were in duplicated in two places
in that file!  This change removes that duplication.  It also adds new sections
on “Where should I put a new test?” and “TestCase and its subclasses”, and
others like “Test feature dependencies” have been expanded.  The whole document
has generally been edited to be a bit more coherent. 

Show diffs side-by-side

added added

removed removed

Lines of Context:
12
12
#
13
13
# You should have received a copy of the GNU General Public License
14
14
# along with this program; if not, write to the Free Software
15
 
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
 
15
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
16
16
 
17
17
"""Black-box tests for bzr revert."""
18
18
 
46
46
        self.assertEquals('modified:\n  dir/file\n', self.run_bzr('status')[0])
47
47
 
48
48
    def _prepare_rename_mod_tree(self):
49
 
        self.build_tree(['a/', 'a/b', 'a/c', 'a/d/', 'a/d/e', 'f/', 'f/g',
 
49
        self.build_tree(['a/', 'a/b', 'a/c', 'a/d/', 'a/d/e', 'f/', 'f/g', 
50
50
                         'f/h', 'f/i'])
51
51
        self.run_bzr('init')
52
52
        self.run_bzr('add')
96
96
        self.failUnlessExists('a/b')
97
97
        self.failUnlessExists('a/d')
98
98
        self.failIfExists('a/g')
99
 
        self.expectFailure(
100
 
            "j is in the delta revert applies because j was renamed too",
101
 
            self.failUnlessExists, 'j')
 
99
        self.failUnlessExists('j')
102
100
        self.failUnlessExists('h')
103
101
        self.run_bzr('revert f')
104
102
        self.failIfExists('j')
156
154
                             os.readlink('symlink'))
157
155
        else:
158
156
            self.log("skipping revert symlink tests")
159
 
 
 
157
        
160
158
        file('hello', 'wt').write('xyz')
161
159
        self.run_bzr('commit -m xyz hello')
162
160
        self.run_bzr('revert -r 1 hello')