/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 breezy/tests/blackbox/test_patch.py

  • Committer: Jelmer Vernooij
  • Date: 2019-06-03 23:48:08 UTC
  • mfrom: (7316 work)
  • mto: This revision was merged to the branch mainline in revision 7328.
  • Revision ID: jelmer@jelmer.uk-20190603234808-15yk5c7054tj8e2b
Merge trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# Copyright (C) 2019 Breezy Developers
 
2
#
 
3
# This program is free software; you can redistribute it and/or modify
 
4
# it under the terms of the GNU General Public License as published by
 
5
# the Free Software Foundation; either version 2 of the License, or
 
6
# (at your option) any later version.
 
7
#
 
8
# This program is distributed in the hope that it will be useful,
 
9
# but WITHOUT ANY WARRANTY; without even the implied warranty of
 
10
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
11
# GNU General Public License for more details.
 
12
#
 
13
# You should have received a copy of the GNU General Public License
 
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
 
16
 
 
17
 
 
18
from breezy.tests import TestCaseWithTransport
 
19
 
 
20
 
 
21
class TestPatch(TestCaseWithTransport):
 
22
 
 
23
    def test_patch(self):
 
24
        self.run_bzr('init')
 
25
        with open('myfile', 'w') as f:
 
26
            f.write('hello')
 
27
        self.run_bzr('add')
 
28
        self.run_bzr('commit -m hello')
 
29
        with open('myfile', 'w') as f:
 
30
            f.write('goodbye')
 
31
        with open('mypatch', 'w') as f:
 
32
            f.write(self.run_bzr('diff -p1', retcode=1)[0])
 
33
        self.run_bzr('revert')
 
34
        self.assertFileEqual('hello', 'myfile')
 
35
        self.run_bzr('patch -p1 --silent mypatch')
 
36
        self.assertFileEqual('goodbye', 'myfile')