From e991bf21bd02d4c06b55a1a1bccc541adb74f509 Mon Sep 17 00:00:00 2001 From: hpk Date: Sun, 28 Jan 2007 17:56:42 +0100 Subject: [PATCH] [svn r37478] refactored/streamlined tests slightly i think svn testing needs some more refinements (not before 0.9) --HG-- branch : trunk --- py/path/svn/testing/svntestbase.py | 13 +++++++------ py/path/svn/testing/test_urlcommand.py | 27 ++++++-------------------- 2 files changed, 13 insertions(+), 27 deletions(-) diff --git a/py/path/svn/testing/svntestbase.py b/py/path/svn/testing/svntestbase.py index 8a03f770f..d36ff4ceb 100644 --- a/py/path/svn/testing/svntestbase.py +++ b/py/path/svn/testing/svntestbase.py @@ -103,13 +103,14 @@ class CommonSvnTests(CommonFSTests): res = url.info() assert res.size > len("samplefile") and res.created_rev >= 0 - def xxxtest_info_log(self): + def test_log_simple(self): + py.test.skip("XXX: does not work at least on svn below 1.3") url = self.root.join("samplefile") - res = url.log(rev_start=1155, rev_end=1155, verbose=True) - assert res[0].revision == 1155 and res[0].author == "jum" - from time import gmtime - t = gmtime(res[0].date) - assert t.tm_year == 2003 and t.tm_mon == 7 and t.tm_mday == 17 + logentries = url.log() + for logentry in logentries: + assert logentry.rev == 1 + assert hasattr(logentry, 'author') + assert hasattr(logentry, 'date') class CommonCommandAndBindingTests(CommonSvnTests): def test_trailing_slash_is_stripped(self): diff --git a/py/path/svn/testing/test_urlcommand.py b/py/path/svn/testing/test_urlcommand.py index aab4de9f7..375b0b9d6 100644 --- a/py/path/svn/testing/test_urlcommand.py +++ b/py/path/svn/testing/test_urlcommand.py @@ -5,9 +5,9 @@ from py.__.path.svn.testing.svntestbase import CommonCommandAndBindingTests, \ import datetime import time - -if py.path.local.sysfind('svn') is None: - py.test.skip("cannot test py.path.svn, 'svn' binary not found") +def setup_module(mod): + if py.path.local.sysfind('svn') is None: + py.test.skip("cannot test py.path.svn, 'svn' binary not found") class TestSvnCommandPath(CommonCommandAndBindingTests): def setup_class(cls): @@ -32,6 +32,9 @@ class TestSvnCommandPath(CommonCommandAndBindingTests): def test_svnurl_characters_colon_port(self): py.path.svnurl("http://host.com:8080/some/dir") + def test_svnurl_characters_tilde_end(self): + py.path.svnurl("http://host.com/some/file~") + def test_svnurl_characters_colon_path(self): if py.std.sys.platform == 'win32': # colons are allowed on win32, because they're part of the drive @@ -39,24 +42,6 @@ class TestSvnCommandPath(CommonCommandAndBindingTests): # other parts, I think py.test.skip('XXX fixme win32') py.test.raises(ValueError, 'py.path.svnurl("http://host.com/foo:bar")') - - def test_svnurl_characters_tilde_end(self): - py.path.svnurl("http://host.com/some/file~") - - # XXX - def xtest_copy_file(self): - raise py.test.Skipped(msg="XXX fix svnurl first") - - def xtest_copy_dir(self): - py.test.skipp("XXX fix svnurl first") - - def XXXtest_info_log(self): - url = self.root.join("samplefile") - res = url.log(rev_start=1155, rev_end=1155, verbose=True) - assert res[0].revision == 1155 and res[0].author == "jum" - from time import gmtime - t = gmtime(res[0].date) - assert t.tm_year == 2003 and t.tm_mon == 7 and t.tm_mday == 17 class TestSvnInfoCommand: