~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Patch Queue Manager
  • Date: 2016-02-01 19:13:13 UTC
  • mfrom: (6614.2.2 trunk)
  • Revision ID: pqm@pqm.ubuntu.com-20160201191313-wdfvmfff1djde6oq
(vila) Release 2.7.0 (Vincent Ladeuil)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2005, 2006, 2007, 2009 Canonical Ltd
 
1
# Copyright (C) 2005, 2006, 2007, 2009, 2011, 2012, 2016 Canonical Ltd
2
2
#
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
21
21
import os
22
22
 
23
23
from bzrlib import tests
 
24
from bzrlib.tests.matchers import ContainsNoVfsCalls
 
25
 
24
26
 
25
27
class TestRevno(tests.TestCaseWithTransport):
26
28
 
32
34
        os.mkdir('a')
33
35
        os.chdir('a')
34
36
        bzr('init')
35
 
        self.assertEquals(int(bzr('revno')), 0)
 
37
        self.assertEqual(int(bzr('revno')), 0)
36
38
 
37
 
        open('foo', 'wb').write('foo\n')
 
39
        with open('foo', 'wb') as f: f.write('foo\n')
38
40
        bzr('add foo')
39
41
        bzr('commit -m foo')
40
 
        self.assertEquals(int(bzr('revno')), 1)
 
42
        self.assertEqual(int(bzr('revno')), 1)
41
43
 
42
44
        os.mkdir('baz')
43
45
        bzr('add baz')
44
46
        bzr('commit -m baz')
45
 
        self.assertEquals(int(bzr('revno')), 2)
 
47
        self.assertEqual(int(bzr('revno')), 2)
46
48
 
47
49
        os.chdir('..')
48
 
        self.assertEquals(int(bzr('revno a')), 2)
49
 
        self.assertEquals(int(bzr('revno a/baz')), 2)
 
50
        self.assertEqual(int(bzr('revno a')), 2)
 
51
        self.assertEqual(int(bzr('revno a/baz')), 2)
50
52
 
51
53
    def test_revno_tree(self):
52
54
        # Make branch and checkout
153
155
        # being too low. If rpc_count increases, more network roundtrips have
154
156
        # become necessary for this use case. Please do not adjust this number
155
157
        # upwards without agreement from bzr's network support maintainers.
 
158
        self.assertThat(self.hpss_calls, ContainsNoVfsCalls)
 
159
        self.assertLength(1, self.hpss_connections)
156
160
        self.assertLength(6, self.hpss_calls)
157
161
 
158
162
    def test_simple_branch_revno_lookup(self):
171
175
        # become necessary for this use case. Please do not adjust this number
172
176
        # upwards without agreement from bzr's network support maintainers.
173
177
        self.assertLength(5, self.hpss_calls)
 
178
        self.assertLength(1, self.hpss_connections)
 
179
        self.assertThat(self.hpss_calls, ContainsNoVfsCalls)