~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/selftest/blackbox.py

  • Committer: Robert Collins
  • Date: 2005-10-04 04:37:29 UTC
  • mto: This revision was merged to the branch mainline in revision 1401.
  • Revision ID: robertc@robertcollins.net-20051004043729-562c506f88535c26
implement a basic test for the ui branch command from http servers

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
 
21
21
These check that it behaves properly when it's invoked through the regular
22
22
command-line interface.
23
 
 
24
 
This always reinvokes bzr through a new Python interpreter, which is a
25
 
bit inefficient but arguably tests in a way more representative of how
26
 
it's normally invoked.
27
23
"""
28
24
 
29
25
from cStringIO import StringIO
35
31
from bzrlib.selftest import TestCaseInTempDir, BzrTestBase
36
32
from bzrlib.branch import Branch
37
33
from bzrlib.osutils import has_symlinks
 
34
from bzrlib.selftest.HTTPTestUtil import TestCaseWithWebserver
38
35
 
39
36
 
40
37
class ExternalBase(TestCaseInTempDir):
679
676
            chdir("..")
680
677
        else:
681
678
            progress("skipping symlink tests")
682
 
            
 
679
 
 
680
 
 
681
class HttpTests(TestCaseWithWebserver):
 
682
    """Test bzr ui commands against remote branches."""
 
683
 
 
684
    def test_branch(self):
 
685
        os.mkdir('from')
 
686
        branch = Branch.initialize('from')
 
687
        branch.commit('empty commit for nonsense', allow_pointless=True)
 
688
        url = self.get_remote_url('from')
 
689
        self.run_bzr('branch', url, 'to')
 
690
        branch = Branch.open('to')
 
691
        self.assertEqual(1, len(branch.revision_history()))