Rev 1062: Add repos tests. in file:///data/jelmer/bzr-svn/cext/

Jelmer Vernooij jelmer at samba.org
Tue Jun 3 04:08:33 BST 2008


At file:///data/jelmer/bzr-svn/cext/

------------------------------------------------------------
revno: 1062
revision-id: jelmer at samba.org-20080603030832-e2bgz7dx2inlrw71
parent: jelmer at samba.org-20080603021113-ltbwymf4kyspcgx8
committer: Jelmer Vernooij <jelmer at samba.org>
branch nick: cext
timestamp: Tue 2008-06-03 05:08:32 +0200
message:
  Add repos tests.
added:
  tests/test_client.py           test_client.py-20080603021344-lmgexez0yoyp9b1s-1
  tests/test_repos.py            test_repos.py-20080603030558-86ewiakm2z5y9x29-1
renamed:
  tests/test_repos.py => tests/test_repository.py test_repos.py-20060508151940-ddc49a59257ca712
modified:
  client.c                       client.pyx-20080313235339-wbyjbw2namuiql8f-1
  ra.c                           ra.pyx-20080313140933-qybkqaxe3m4mcll7-1
  tests/__init__.py              __init__.py-20060508151940-e9f4d914801a2535
  tests/test_radir.py            test_radir.py-20061231173434-31utf9o4byu7wktm-1
=== modified file 'client.c'
--- a/client.c	2008-06-03 02:11:13 +0000
+++ b/client.c	2008-06-03 03:08:32 +0000
@@ -62,6 +62,9 @@
     py_commit_items = PyList_New(commit_items->nelts);
 	if (py_commit_items == NULL)
 		return py_svn_error();
+
+	assert(commit_items->elt_size == sizeof(svn_client_commit_item_2_t *));
+
 	for (i = 0; i < commit_items->nelts; i++) {
 		svn_client_commit_item2_t *commit_item = 
 			(svn_client_commit_item2_t *)(commit_items->elts + i * commit_items->elt_size);

=== modified file 'ra.c'
--- a/ra.c	2008-06-03 02:11:13 +0000
+++ b/ra.c	2008-06-03 03:08:32 +0000
@@ -804,7 +804,7 @@
     apr_hash_t *dirents;
     apr_hash_index_t *idx;
     apr_hash_t *props;
-    long fetch_rev;
+    svn_revnum_t fetch_rev;
     const char *key;
 	RemoteAccessObject *ra = (RemoteAccessObject *)self;
     svn_dirent_t *dirent;
@@ -821,6 +821,9 @@
 	if (temp_pool == NULL)
 		return NULL;
 
+	if (revision != SVN_INVALID_REVNUM)
+		fetch_rev = revision;
+
 	if (!check_error(svn_ra_get_dir2(ra->ra, &dirents, &fetch_rev, &props,
                      path, revision, dirent_fields, temp_pool))) {
 		apr_pool_destroy(temp_pool);
@@ -861,7 +864,7 @@
 
 	py_props = prop_hash_to_dict(props);
 	apr_pool_destroy(temp_pool);
-	return Py_BuildValue("(OiO)", py_dirents, fetch_rev, py_props);
+	return Py_BuildValue("(OlO)", py_dirents, fetch_rev, py_props);
 }
 
 static PyObject *ra_get_lock(PyObject *self, PyObject *args)

=== modified file 'tests/__init__.py'
--- a/tests/__init__.py	2008-06-02 20:15:47 +0000
+++ b/tests/__init__.py	2008-06-03 03:08:32 +0000
@@ -242,6 +242,7 @@
             'test_branchprops', 
             'test_changes',
             'test_checkout',
+            'test_client',
             'test_commit',
             'test_config',
             'test_convert',
@@ -254,6 +255,7 @@
             'test_ra',
             'test_radir',
             'test_repos', 
+            'test_repository', 
             'test_revids',
             'test_revspec',
             'test_scheme', 

=== added file 'tests/test_client.py'
--- a/tests/test_client.py	1970-01-01 00:00:00 +0000
+++ b/tests/test_client.py	2008-06-03 03:08:32 +0000
@@ -0,0 +1,30 @@
+# Copyright (C) 2005-2007 Jelmer Vernooij <jelmer at samba.org>
+ 
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+"""Subversion client library tests."""
+
+from bzrlib.tests import TestCase
+import client
+from tests import TestCaseWithSubversionRepository
+
+class TestClient(TestCaseWithSubversionRepository):
+    def setUp(self):
+        super(TestClient, self).setUp()
+        self.repos_url = self.make_client("d", "dc")
+        self.client = client.Client()
+
+    def test_add(self):
+        self.build_tree({"dc/foo": None})
+        self.client.add("dc/foo")

=== modified file 'tests/test_radir.py'
--- a/tests/test_radir.py	2008-06-03 02:11:13 +0000
+++ b/tests/test_radir.py	2008-06-03 03:08:32 +0000
@@ -28,8 +28,6 @@
 
 class TestRemoteAccess(TestCaseWithSubversionRepository):
     def test_clone(self):
-        import pdb
-        pdb.set_trace()
         repos_url = self.make_client("d", "dc")
         self.build_tree({"dc/foo": None})
         self.client_add("dc/foo")

=== added file 'tests/test_repos.py'
--- a/tests/test_repos.py	1970-01-01 00:00:00 +0000
+++ b/tests/test_repos.py	2008-06-03 03:08:32 +0000
@@ -0,0 +1,35 @@
+# Copyright (C) 2005-2007 Jelmer Vernooij <jelmer at samba.org>
+ 
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+"""Subversion rpeository library tests."""
+
+import os
+import repos
+from bzrlib.tests import TestCaseInTempDir
+
+class TestClient(TestCaseInTempDir):
+    def setUp(self):
+        super(TestClient, self).setUp()
+
+    def test_create(self):
+        repos.create(os.path.join(self.test_dir, "foo"))
+
+    def test_open(self):
+        repos.create(os.path.join(self.test_dir, "foo"))
+        repos.Repository("foo")
+
+    def test_uuid(self):
+        repos.create(os.path.join(self.test_dir, "foo"))
+        self.assertIsInstance(repos.Repository("foo").fs().get_uuid(), str)

=== renamed file 'tests/test_repos.py' => 'tests/test_repository.py'



More information about the bazaar-commits mailing list