Rev 1205: Avoid using svn.client in more tests. in file:///data/jelmer/bzr-svn/fast-tests/
Jelmer Vernooij
jelmer at samba.org
Thu Jun 5 03:22:29 BST 2008
At file:///data/jelmer/bzr-svn/fast-tests/
------------------------------------------------------------
revno: 1205
revision-id: jelmer at samba.org-20080605022228-uwbzz1xm76at4r6x
parent: jelmer at samba.org-20080605021758-uycxw84s4z3dybe4
committer: Jelmer Vernooij <jelmer at samba.org>
branch nick: fast-tests
timestamp: Thu 2008-06-05 04:22:28 +0200
message:
Avoid using svn.client in more tests.
modified:
tests/test_branch.py test_branch.py-20060508162215-74ffeb5d608f8e20
tests/test_repos.py test_repos.py-20060508151940-ddc49a59257ca712
=== modified file 'tests/test_branch.py'
--- a/tests/test_branch.py 2008-06-04 15:20:12 +0000
+++ b/tests/test_branch.py 2008-06-05 02:22:28 +0000
@@ -35,13 +35,13 @@
class WorkingSubversionBranch(TestCaseWithSubversionRepository):
def test_last_rev_rev_hist(self):
- repos_url = self.make_client("a", "dc")
+ repos_url = self.make_repository("a")
branch = Branch.open(repos_url)
branch.revision_history()
self.assertEqual(branch.generate_revision_id(0), branch.last_revision())
def test_get_branch_path_root(self):
- repos_url = self.make_client("a", "dc")
+ repos_url = self.make_repository("a")
branch = Branch.open(repos_url)
self.assertEqual("", branch.get_branch_path())
@@ -54,11 +54,11 @@
self.assertEqual("trunk", branch.get_branch_path())
def test_open_nonexistant(self):
- repos_url = self.make_client("a", "dc")
+ repos_url = self.make_repository("a")
self.assertRaises(NotBranchError, Branch.open, repos_url + "/trunk")
def test_last_rev_rev_info(self):
- repos_url = self.make_client("a", "dc")
+ repos_url = self.make_repository("a")
branch = Branch.open(repos_url)
self.assertEqual((1, branch.generate_revision_id(0)),
branch.last_revision_info())
@@ -67,24 +67,24 @@
branch.last_revision_info())
def test_lookup_revision_id_unknown(self):
- repos_url = self.make_client("a", "dc")
+ repos_url = self.make_repository("a")
branch = Branch.open(repos_url)
self.assertRaises(NoSuchRevision,
lambda: branch.lookup_revision_id("bla"))
def test_lookup_revision_id(self):
- repos_url = self.make_client("a", "dc")
+ repos_url = self.make_repository("a")
branch = Branch.open(repos_url)
self.assertEquals(0,
branch.lookup_revision_id(branch.last_revision()))
def test_set_parent(self):
- repos_url = self.make_client('a', 'dc')
+ repos_url = self.make_repository('a')
branch = Branch.open(repos_url)
branch.set_parent("foobar")
def test_num_revnums(self):
- repos_url = self.make_client('a', 'dc')
+ repos_url = self.make_repository('a')
bzrdir = BzrDir.open("svn+"+repos_url)
branch = bzrdir.open_branch()
self.assertEqual(branch.generate_revision_id(0),
@@ -114,47 +114,47 @@
branch.last_revision())
def test_set_revision_history(self):
- repos_url = self.make_client('a', 'dc')
+ repos_url = self.make_repository('a')
branch = Branch.open("svn+"+repos_url)
self.assertRaises(NotImplementedError, branch.set_revision_history, [])
def test_break_lock(self):
- repos_url = self.make_client('a', 'dc')
+ repos_url = self.make_repository('a')
branch = Branch.open("svn+"+repos_url)
branch.control_files.break_lock()
def test_repr(self):
- repos_url = self.make_client('a', 'dc')
+ repos_url = self.make_repository('a')
branch = Branch.open("svn+"+repos_url)
self.assertEqual("SvnBranch('svn+%s')" % repos_url, branch.__repr__())
def test_get_physical_lock_status(self):
- repos_url = self.make_client('a', 'dc')
+ repos_url = self.make_repository('a')
branch = Branch.open("svn+"+repos_url)
self.assertFalse(branch.get_physical_lock_status())
def test_set_push_location(self):
- repos_url = self.make_client('a', 'dc')
+ repos_url = self.make_repository('a')
branch = Branch.open("svn+"+repos_url)
self.assertRaises(NotImplementedError, branch.set_push_location, [])
def test_get_parent(self):
- repos_url = self.make_client('a', 'dc')
+ repos_url = self.make_repository('a')
branch = Branch.open("svn+"+repos_url)
self.assertEqual(None, branch.get_parent())
def test_append_revision(self):
- repos_url = self.make_client('a', 'dc')
+ repos_url = self.make_repository('a')
branch = Branch.open("svn+"+repos_url)
branch.append_revision([])
def test_get_push_location(self):
- repos_url = self.make_client('a', 'dc')
+ repos_url = self.make_repository('a')
branch = Branch.open("svn+"+repos_url)
self.assertIs(None, branch.get_push_location())
def test_revision_history(self):
- repos_url = self.make_client('a', 'dc')
+ repos_url = self.make_repository('a')
branch = Branch.open("svn+"+repos_url)
self.assertEqual([branch.generate_revision_id(0)],
@@ -192,14 +192,14 @@
def test_revision_id_to_revno_none(self):
"""The None revid should map to revno 0."""
- repos_url = self.make_client('a', 'dc')
+ repos_url = self.make_repository('a')
branch = Branch.open(repos_url)
self.assertEquals(0, branch.revision_id_to_revno(NULL_REVISION))
def test_revision_id_to_revno_nonexistant(self):
"""revision_id_to_revno() should raise NoSuchRevision if
the specified revision did not exist in the branch history."""
- repos_url = self.make_client('a', 'dc')
+ repos_url = self.make_repository('a')
branch = Branch.open(repos_url)
self.assertRaises(NoSuchRevision, branch.revision_id_to_revno, "bla")
@@ -564,7 +564,7 @@
newbranch.repository.unlock()
def test_check(self):
- self.make_client('d', 'dc')
+ self.make_repository('d')
branch = Branch.open('d')
result = branch.check()
self.assertEqual(branch, result.branch)
=== modified file 'tests/test_repos.py'
--- a/tests/test_repos.py 2008-06-04 15:20:12 +0000
+++ b/tests/test_repos.py 2008-06-05 02:22:28 +0000
@@ -56,10 +56,10 @@
"Subversion Local Checkout")
def test_get_branch_log(self):
- repos_url = self.make_client("a", "dc")
- self.build_tree({'dc/foo': "data"})
- self.client_add("dc/foo")
- self.client_commit("dc", "My Message")
+ repos_url = self.make_repository("a")
+ cb = self.commit_editor(repos_url)
+ cb.add_file("foo")
+ cb.done()
repos = Repository.open(repos_url)
More information about the bazaar-commits
mailing list