summaryrefslogtreecommitdiff
path: root/git/test
diff options
context:
space:
mode:
Diffstat (limited to 'git/test')
-rw-r--r--git/test/lib/asserts.py8
-rw-r--r--git/test/lib/helper.py13
-rw-r--r--git/test/performance/lib.py2
-rw-r--r--git/test/performance/test_commit.py1
-rw-r--r--git/test/performance/test_streams.py4
-rw-r--r--git/test/performance/test_utils.py4
-rw-r--r--git/test/test_actor.py2
-rw-r--r--git/test/test_base.py1
-rw-r--r--git/test/test_blob.py1
-rw-r--r--git/test/test_commit.py1
-rw-r--r--git/test/test_config.py1
-rw-r--r--git/test/test_db.py1
-rw-r--r--git/test/test_diff.py1
-rw-r--r--git/test/test_fun.py4
-rw-r--r--git/test/test_git.py3
-rw-r--r--git/test/test_index.py8
-rw-r--r--git/test/test_reflog.py2
-rw-r--r--git/test/test_refs.py8
-rw-r--r--git/test/test_remote.py5
-rw-r--r--git/test/test_repo.py9
-rw-r--r--git/test/test_stats.py1
-rw-r--r--git/test/test_submodule.py9
-rw-r--r--git/test/test_tree.py2
-rw-r--r--git/test/test_util.py3
24 files changed, 52 insertions, 42 deletions
diff --git a/git/test/lib/asserts.py b/git/test/lib/asserts.py
index 52f07eb3..ec3eef96 100644
--- a/git/test/lib/asserts.py
+++ b/git/test/lib/asserts.py
@@ -15,35 +15,43 @@ __all__ = ['assert_instance_of', 'assert_not_instance_of',
'assert_match', 'assert_not_match', 'assert_mode_644',
'assert_mode_755'] + tools.__all__
+
def assert_instance_of(expected, actual, msg=None):
"""Verify that object is an instance of expected """
assert isinstance(actual, expected), msg
+
def assert_not_instance_of(expected, actual, msg=None):
"""Verify that object is not an instance of expected """
assert not isinstance(actual, expected, msg)
+
def assert_none(actual, msg=None):
"""verify that item is None"""
assert actual is None, msg
+
def assert_not_none(actual, msg=None):
"""verify that item is None"""
assert actual is not None, msg
+
def assert_match(pattern, string, msg=None):
"""verify that the pattern matches the string"""
assert_not_none(re.search(pattern, string), msg)
+
def assert_not_match(pattern, string, msg=None):
"""verify that the pattern does not match the string"""
assert_none(re.search(pattern, string), msg)
+
def assert_mode_644(mode):
"""Verify given mode is 644"""
assert (mode & stat.S_IROTH) and (mode & stat.S_IRGRP)
assert (mode & stat.S_IWUSR) and (mode & stat.S_IRUSR) and not (mode & stat.S_IXUSR)
+
def assert_mode_755(mode):
"""Verify given mode is 755"""
assert (mode & stat.S_IROTH) and (mode & stat.S_IRGRP) and (mode & stat.S_IXOTH) and (mode & stat.S_IXGRP)
diff --git a/git/test/lib/helper.py b/git/test/lib/helper.py
index 4f8cdf33..d5045ad7 100644
--- a/git/test/lib/helper.py
+++ b/git/test/lib/helper.py
@@ -21,13 +21,16 @@ __all__ = (
#{ Routines
+
def fixture_path(name):
test_dir = os.path.dirname(os.path.dirname(__file__))
return os.path.join(test_dir, "fixtures", name)
+
def fixture(name):
return open(fixture_path(name), 'rb').read()
+
def absolute_project_path():
return os.path.abspath(os.path.join(os.path.dirname(__file__), "..", ".."))
@@ -35,7 +38,9 @@ def absolute_project_path():
#{ Adapters
+
class StringProcessAdapter(object):
+
"""Allows to use strings as Process object as returned by SubProcess.Popen.
Its tailored to work with the test system only"""
@@ -52,6 +57,7 @@ class StringProcessAdapter(object):
#{ Decorators
+
def _mktemp(*args):
"""Wrapper around default tempfile.mktemp to fix an osx issue"""
tdir = tempfile.mktemp(*args)
@@ -59,6 +65,7 @@ def _mktemp(*args):
tdir = '/private' + tdir
return tdir
+
def _rmtree_onerror(osremove, fullpath, exec_info):
"""
Handle the case on windows that read-only files cannot be deleted by
@@ -70,6 +77,7 @@ def _rmtree_onerror(osremove, fullpath, exec_info):
os.chmod(fullpath, 0777)
os.remove(fullpath)
+
def with_rw_repo(working_tree_ref, bare=False):
"""
Same as with_bare_repo, but clones the rorepo as non-bare repository, checking
@@ -81,6 +89,7 @@ def with_rw_repo(working_tree_ref, bare=False):
dir of the repository.
"""
assert isinstance(working_tree_ref, basestring), "Decorator requires ref name for working tree checkout"
+
def argument_passer(func):
def repo_creator(self):
prefix = 'non_'
@@ -117,6 +126,7 @@ def with_rw_repo(working_tree_ref, bare=False):
# END argument passer
return argument_passer
+
def with_rw_and_rw_remote_repo(working_tree_ref):
"""
Same as with_rw_repo, but also provides a writable remote repository from which the
@@ -141,6 +151,7 @@ def with_rw_and_rw_remote_repo(working_tree_ref):
See working dir info in with_rw_repo
"""
assert isinstance(working_tree_ref, basestring), "Decorator requires ref name for working tree checkout"
+
def argument_passer(func):
def remote_repo_creator(self):
remote_repo_dir = _mktemp("remote_repo_%s" % func.__name__)
@@ -208,7 +219,9 @@ def with_rw_and_rw_remote_repo(working_tree_ref):
#} END decorators
+
class TestBase(TestCase):
+
"""
Base Class providing default functionality to all tests such as:
diff --git a/git/test/performance/lib.py b/git/test/performance/lib.py
index acf2e4d5..28500da4 100644
--- a/git/test/performance/lib.py
+++ b/git/test/performance/lib.py
@@ -33,6 +33,7 @@ def resolve_or_fail(env_var):
#{ Base Classes
class TestBigRepoR(TestBase):
+
"""TestCase providing access to readonly 'big' repositories using the following
member variables:
@@ -59,6 +60,7 @@ class TestBigRepoR(TestBase):
class TestBigRepoRW(TestBigRepoR):
+
"""As above, but provides a big repository that we can write to.
Provides ``self.gitrwrepo`` and ``self.puregitrwrepo``"""
diff --git a/git/test/performance/test_commit.py b/git/test/performance/test_commit.py
index c3d89931..79555844 100644
--- a/git/test/performance/test_commit.py
+++ b/git/test/performance/test_commit.py
@@ -12,6 +12,7 @@ from cStringIO import StringIO
from time import time
import sys
+
class TestPerformance(TestBigRepoRW):
# ref with about 100 commits in its history
diff --git a/git/test/performance/test_streams.py b/git/test/performance/test_streams.py
index cac53a06..c8b59da6 100644
--- a/git/test/performance/test_streams.py
+++ b/git/test/performance/test_streams.py
@@ -44,7 +44,6 @@ class TestObjDBPerformance(TestBigRepoR):
db_file = ldb.readable_db_object_path(bin_to_hex(binsha))
fsize_kib = os.path.getsize(db_file) / 1000
-
size_kib = size / 1000
print >> sys.stderr, "Added %i KiB (filesize = %i KiB) of %s data to loose odb in %f s ( %f Write KiB / s)" % (size_kib, fsize_kib, desc, elapsed_add, size_kib / elapsed_add)
@@ -58,7 +57,6 @@ class TestObjDBPerformance(TestBigRepoR):
assert shadata == stream.getvalue()
print >> sys.stderr, "Read %i KiB of %s data at once from loose odb in %f s ( %f Read KiB / s)" % (size_kib, desc, elapsed_readall, size_kib / elapsed_readall)
-
# reading in chunks of 1 MiB
cs = 512*1000
chunks = list()
@@ -104,7 +102,6 @@ class TestObjDBPerformance(TestBigRepoR):
# compare ...
print >> sys.stderr, "Git-Python is %f %% faster than git when adding big %s files" % (100.0 - (elapsed_add / gelapsed_add) * 100, desc)
-
# read all
st = time()
s, t, size, data = rwrepo.git.get_object_data(gitsha)
@@ -114,7 +111,6 @@ class TestObjDBPerformance(TestBigRepoR):
# compare
print >> sys.stderr, "Git-Python is %f %% faster than git when reading big %sfiles" % (100.0 - (elapsed_readall / gelapsed_readall) * 100, desc)
-
# read chunks
st = time()
s, t, size, stream = rwrepo.git.stream_object_data(gitsha)
diff --git a/git/test/performance/test_utils.py b/git/test/performance/test_utils.py
index 7de77970..4979eaa1 100644
--- a/git/test/performance/test_utils.py
+++ b/git/test/performance/test_utils.py
@@ -14,20 +14,24 @@ class TestUtilPerformance(TestBigRepoR):
# compare dict vs. slot access
class Slotty(object):
__slots__ = "attr"
+
def __init__(self):
self.attr = 1
class Dicty(object):
+
def __init__(self):
self.attr = 1
class BigSlotty(object):
__slots__ = ('attr', ) + tuple('abcdefghijk')
+
def __init__(self):
for attr in self.__slots__:
setattr(self, attr, 1)
class BigDicty(object):
+
def __init__(self):
for attr in BigSlotty.__slots__:
setattr(self, attr, 1)
diff --git a/git/test/test_actor.py b/git/test/test_actor.py
index 06aa1aed..40e307ba 100644
--- a/git/test/test_actor.py
+++ b/git/test/test_actor.py
@@ -8,7 +8,9 @@ import os
from git.test.lib import *
from git import *
+
class TestActor(object):
+
def test_from_string_should_separate_name_and_email(self):
a = Actor._from_string("Michael Trier <mtrier@example.com>")
assert_equal("Michael Trier", a.name)
diff --git a/git/test/test_base.py b/git/test/test_base.py
index d867242c..42b95b39 100644
--- a/git/test/test_base.py
+++ b/git/test/test_base.py
@@ -15,6 +15,7 @@ from git.objects.util import get_object_type_by_name
from gitdb.util import hex_to_bin
import tempfile
+
class TestBase(TestBase):
type_tuples = ( ("blob", "8741fc1d09d61f02ffd8cded15ff603eff1ec070", "blob.py"),
diff --git a/git/test/test_blob.py b/git/test/test_blob.py
index ca78f892..a1d95ac2 100644
--- a/git/test/test_blob.py
+++ b/git/test/test_blob.py
@@ -8,6 +8,7 @@ from git.test.lib import *
from git import *
from gitdb.util import hex_to_bin
+
class TestBlob(TestBase):
def test_mime_type_should_return_mime_type_for_known_types(self):
diff --git a/git/test/test_commit.py b/git/test/test_commit.py
index d6ad3a62..d6e13762 100644
--- a/git/test/test_commit.py
+++ b/git/test/test_commit.py
@@ -82,7 +82,6 @@ class TestCommit(TestBase):
assert isinstance(commit.author_tz_offset, int) and isinstance(commit.committer_tz_offset, int)
assert commit.message == "Added missing information to docstrings of commit and stats module\n"
-
def test_stats(self):
commit = self.rorepo.commit('33ebe7acec14b25c5f84f35a664803fcab2f7781')
stats = commit.stats
diff --git a/git/test/test_config.py b/git/test/test_config.py
index 3884e877..cd1c43ed 100644
--- a/git/test/test_config.py
+++ b/git/test/test_config.py
@@ -10,6 +10,7 @@ import StringIO
from copy import copy
from ConfigParser import NoSectionError
+
class TestBase(TestCase):
def _to_memcache(self, file_path):
diff --git a/git/test/test_db.py b/git/test/test_db.py
index 4bac5647..b53c4209 100644
--- a/git/test/test_db.py
+++ b/git/test/test_db.py
@@ -9,6 +9,7 @@ from gitdb.util import bin_to_hex
from git.exc import BadObject
import os
+
class TestDB(TestBase):
def test_base(self):
diff --git a/git/test/test_diff.py b/git/test/test_diff.py
index a59ee0bf..3c2537da 100644
--- a/git/test/test_diff.py
+++ b/git/test/test_diff.py
@@ -7,6 +7,7 @@
from git.test.lib import *
from git import *
+
class TestDiff(TestBase):
def _assert_diff_format(self, diffs):
diff --git a/git/test/test_fun.py b/git/test/test_fun.py
index 129df3b9..f435f31b 100644
--- a/git/test/test_fun.py
+++ b/git/test/test_fun.py
@@ -23,6 +23,7 @@ from stat import (
from git.index import IndexFile
from cStringIO import StringIO
+
class TestFun(TestBase):
def _assert_index_entries(self, entries, trees):
@@ -78,8 +79,10 @@ class TestFun(TestBase):
def test_three_way_merge(self, rwrepo):
def mkfile(name, sha, executable=0):
return (sha, S_IFREG | 0644 | executable*0111, name)
+
def mkcommit(name, sha):
return (sha, S_IFDIR | S_IFLNK, name)
+
def assert_entries(entries, num_entries, has_conflict=False):
assert len(entries) == num_entries
assert has_conflict == (len([e for e in entries if e.stage != 0]) > 0)
@@ -156,7 +159,6 @@ class TestFun(TestBase):
trees = [tb, th, tm]
assert_entries(aggressive_tree_merge(odb, trees), 3, True)
-
# change mode on same base file, by making one a commit, the other executable
# no content change ( this is totally unlikely to happen in the real world )
fa = mkcommit(bfn, shaa)
diff --git a/git/test/test_git.py b/git/test/test_git.py
index c06b5e24..06410c45 100644
--- a/git/test/test_git.py
+++ b/git/test/test_git.py
@@ -15,6 +15,7 @@ from git.test.lib import ( TestBase,
from git import ( Git,
GitCommandError )
+
class TestGit(TestBase):
@classmethod
@@ -41,7 +42,6 @@ class TestGit(TestBase):
def test_it_raises_errors(self):
self.git.this_does_not_exist()
-
def test_it_transforms_kwargs_into_git_command_arguments(self):
assert_equal(["-s"], self.git.transform_kwargs(**{'s': True}))
assert_equal(["-s5"], self.git.transform_kwargs(**{'s': 5}))
@@ -93,7 +93,6 @@ class TestGit(TestBase):
g.stdin.flush()
assert g.stdout.readline() == obj_info
-
# same can be achived using the respective command functions
hexsha, typename, size = self.git.get_object_header(hexsha)
hexsha, typename_two, size_two, data = self.git.get_object_data(hexsha)
diff --git a/git/test/test_index.py b/git/test/test_index.py
index 9d75da53..b902f4d5 100644
--- a/git/test/test_index.py
+++ b/git/test/test_index.py
@@ -14,6 +14,7 @@ import glob
import shutil
from stat import *
+
class TestIndex(TestBase):
def __init__(self, *args):
@@ -122,7 +123,6 @@ class TestIndex(TestBase):
three_way_index = IndexFile.from_tree(rw_repo, common_ancestor_sha, cur_sha, other_sha)
assert len(list(e for e in three_way_index.entries.values() if e.stage != 0))
-
# ITERATE BLOBS
merge_required = lambda t: t[0] != 0
merge_blobs = list(three_way_index.iter_blobs(merge_required))
@@ -135,7 +135,6 @@ class TestIndex(TestBase):
for stage, blob in base_index.iter_blobs(BlobFilter([prefix])):
assert blob.path.startswith(prefix)
-
# writing a tree should fail with an unmerged index
self.failUnlessRaises(UnmergedEntriesError, three_way_index.write_tree)
@@ -213,7 +212,6 @@ class TestIndex(TestBase):
unmerged_blobs = unmerged_tree.unmerged_blobs()
assert len(unmerged_blobs) == 1 and unmerged_blobs.keys()[0] == manifest_key[0]
-
@with_rw_repo('0.1.6')
def test_index_file_diffing(self, rw_repo):
# default Index instance points to our index
@@ -572,10 +570,10 @@ class TestIndex(TestBase):
rval = index.move(['doc', 'test'])
assert_mv_rval(rval)
-
# TEST PATH REWRITING
######################
count = [0]
+
def rewriter(entry):
rval = str(count[0])
count[0] += 1
@@ -601,7 +599,6 @@ class TestIndex(TestBase):
for filenum in range(len(paths)):
assert index.entry_key(str(filenum), 0) in index.entries
-
# TEST RESET ON PATHS
######################
arela = "aa"
@@ -640,7 +637,6 @@ class TestIndex(TestBase):
for absfile in absfiles:
assert os.path.isfile(absfile)
-
@with_rw_repo('HEAD')
def test_compare_write_tree(self, rw_repo):
# write all trees and compare them
diff --git a/git/test/test_reflog.py b/git/test/test_reflog.py
index ba3a531b..76cfd870 100644
--- a/git/test/test_reflog.py
+++ b/git/test/test_reflog.py
@@ -7,6 +7,7 @@ import tempfile
import shutil
import os
+
class TestRefLog(TestBase):
def test_reflogentry(self):
@@ -95,6 +96,5 @@ class TestRefLog(TestBase):
#END for each index to read
# END for each reflog
-
# finally remove our temporary data
shutil.rmtree(tdir)
diff --git a/git/test/test_refs.py b/git/test/test_refs.py
index 5eb214ba..fc58dafa 100644
--- a/git/test/test_refs.py
+++ b/git/test/test_refs.py
@@ -13,6 +13,7 @@ from git.objects.tag import TagObject
from itertools import chain
import os
+
class TestRefs(TestBase):
def test_from_path(self):
@@ -55,7 +56,6 @@ class TestRefs(TestBase):
assert tag_object_refs
assert isinstance(self.rorepo.tags['0.1.5'], TagReference)
-
def test_tags_author(self):
tag = self.rorepo.tags[0]
tagobj = tag.tag
@@ -63,8 +63,6 @@ class TestRefs(TestBase):
tagger_name = tagobj.tagger.name
assert tagger_name == 'Michael Trier'
-
-
def test_tags(self):
# tag refs can point to tag objects or to commits
s = set()
@@ -138,7 +136,6 @@ class TestRefs(TestBase):
assert len(cur_head.log()) == blog_len+1
assert len(head.log()) == hlog_len+3
-
# with automatic dereferencing
assert head.set_commit(cur_commit, 'change commit once again') is head
assert len(head.log()) == hlog_len+4
@@ -151,7 +148,6 @@ class TestRefs(TestBase):
assert log[0].oldhexsha == pcommit.NULL_HEX_SHA
assert log[0].newhexsha == pcommit.hexsha
-
def test_refs(self):
types_found = set()
for ref in self.rorepo.refs:
@@ -191,7 +187,6 @@ class TestRefs(TestBase):
cur_head.reset(new_head_commit)
rw_repo.index.checkout(["lib"], force=True)#
-
# now that we have a write write repo, change the HEAD reference - its
# like git-reset --soft
heads = rw_repo.heads
@@ -499,7 +494,6 @@ class TestRefs(TestBase):
refs = list(SymbolicReference.iter_items(rw_repo))
assert len(refs) == 1
-
# test creation of new refs from scratch
for path in ("basename", "dir/somename", "dir2/subdir/basename"):
# REFERENCES
diff --git a/git/test/test_remote.py b/git/test/test_remote.py
index 0b7ab574..19d029e5 100644
--- a/git/test/test_remote.py
+++ b/git/test/test_remote.py
@@ -15,8 +15,10 @@ import random
# assure we have repeatable results
random.seed(0)
+
class TestRemoteProgress(RemoteProgress):
__slots__ = ( "_seen_lines", "_stages_per_op", '_num_progress_messages' )
+
def __init__(self):
super(TestRemoteProgress, self).__init__()
self._seen_lines = list()
@@ -51,7 +53,6 @@ class TestRemoteProgress(RemoteProgress):
self._num_progress_messages += 1
-
def make_assertion(self):
# we don't always receive messages
if not self._seen_lines:
@@ -76,7 +77,6 @@ class TestRemote(TestBase):
fp = open(os.path.join(repo.git_dir, "FETCH_HEAD"))
fp.close()
-
def _do_test_fetch_result(self, results, remote):
# self._print_fetchhead(remote.repo)
assert len(results) > 0 and isinstance(results[0], FetchInfo)
@@ -116,7 +116,6 @@ class TestRemote(TestBase):
# END error checking
# END for each info
-
def _do_test_fetch_info(self, repo):
self.failUnlessRaises(ValueError, FetchInfo._from_line, repo, "nonsense", '')
self.failUnlessRaises(ValueError, FetchInfo._from_line, repo, "? [up to date] 0.1.7RC -> origin/0.1.7RC", '')
diff --git a/git/test/test_repo.py b/git/test/test_repo.py
index 1ecd2ae4..38c03b7a 100644
--- a/git/test/test_repo.py
+++ b/git/test/test_repo.py
@@ -103,7 +103,6 @@ class TestRepo(TestBase):
# END for each tree
assert num_trees == mc
-
def _assert_empty_repo(self, repo):
# test all kinds of things with an empty, freshly initialized repo.
# It should throw good errors
@@ -131,7 +130,6 @@ class TestRepo(TestBase):
pass
# END test repos with working tree
-
def test_init(self):
prev_cwd = os.getcwd()
os.chdir(tempfile.gettempdir())
@@ -153,7 +151,6 @@ class TestRepo(TestBase):
rc = r.clone(clone_path)
self._assert_empty_repo(rc)
-
try:
shutil.rmtree(clone_path)
except OSError:
@@ -362,6 +359,7 @@ class TestRepo(TestBase):
return Git.CatFileContentStream(len(d)-1, StringIO(d))
ts = 5
+
def mktiny():
return Git.CatFileContentStream(ts, StringIO(d))
@@ -434,7 +432,6 @@ class TestRepo(TestBase):
assert obj.type == 'blob' and obj.path == 'CHANGES'
assert rev_obj.tree['CHANGES'] == obj
-
def _assert_rev_parse(self, name):
"""tries multiple different rev-parse syntaxes with the given name
:return: parsed object"""
@@ -521,13 +518,11 @@ class TestRepo(TestBase):
assert tag.object == rev_parse(tag.object.hexsha)
self._assert_rev_parse_types(tag.object.hexsha, tag.object)
-
# multiple tree types result in the same tree: HEAD^{tree}^{tree}:CHANGES
rev = '0.1.4^{tree}^{tree}'
assert rev_parse(rev) == tag.object.tree
assert rev_parse(rev+':CHANGES') == tag.object.tree['CHANGES']
-
# try to get parents from first revision - it should fail as no such revision
# exists
first_rev = "33ebe7acec14b25c5f84f35a664803fcab2f7781"
@@ -543,11 +538,9 @@ class TestRepo(TestBase):
commit2 = rev_parse(first_rev[:5])
assert commit2 == commit
-
# todo: dereference tag into a blob 0.1.7^{blob} - quite a special one
# needs a tag which points to a blob
-
# ref^0 returns commit being pointed to, same with ref~0, and ^{}
tag = rev_parse('0.1.4')
for token in (('~0', '^0', '^{}')):
diff --git a/git/test/test_stats.py b/git/test/test_stats.py
index ede73153..d827c680 100644
--- a/git/test/test_stats.py
+++ b/git/test/test_stats.py
@@ -7,6 +7,7 @@
from git.test.lib import *
from git import *
+
class TestStats(TestBase):
def test__list_from_string(self):
diff --git a/git/test/test_submodule.py b/git/test/test_submodule.py
index 827705cf..0cf620c1 100644
--- a/git/test/test_submodule.py
+++ b/git/test/test_submodule.py
@@ -25,6 +25,7 @@ if sys.platform == 'win32':
class TestRootProgress(RootUpdateProgress):
+
"""Just prints messages, for now without checking the correctness of the states"""
def update(self, op, index, max_count, message=''):
@@ -32,13 +33,13 @@ class TestRootProgress(RootUpdateProgress):
prog = TestRootProgress()
+
class TestSubmodule(TestBase):
k_subm_current = "468cad66ff1f80ddaeee4123c24e4d53a032c00d"
k_subm_changed = "394ed7006ee5dc8bddfd132b64001d5dfc0ffdd3"
k_no_subm_tag = "0.1.6"
-
def _do_base_tests(self, rwrepo):
"""Perform all tests in the given repository, it may be bare or nonbare"""
# manual instantiation
@@ -168,7 +169,6 @@ class TestSubmodule(TestBase):
# or we raise
self.failUnlessRaises(ValueError, Submodule.add, rwrepo, "newsubm", sm.path, "git://someurl/repo.git")
-
# CONTINUE UPDATE
#################
# we should have setup a tracking branch, which is also active
@@ -208,7 +208,6 @@ class TestSubmodule(TestBase):
# this flushed in a sub-submodule
assert len(list(rwrepo.iter_submodules())) == 2
-
# reset both heads to the previous version, verify that to_latest_revision works
smods = (sm.module(), csm.module())
for repo in smods:
@@ -469,7 +468,6 @@ class TestSubmodule(TestBase):
nsm.remove(configuration=False, module=True)
assert not nsm.module_exists() and nsm.exists()
-
# dry-run does nothing
rm.update(recursive=False, dry_run=True, progress=prog)
@@ -477,8 +475,6 @@ class TestSubmodule(TestBase):
rm.update(recursive=False, progress=prog)
assert nsm.module_exists()
-
-
# remove submodule - the previous one
#====================================
sm.set_parent_commit(csmadded)
@@ -495,7 +491,6 @@ class TestSubmodule(TestBase):
rm.update(recursive=False)
assert not os.path.isdir(smp)
-
# change url
#=============
# to the first repository, this way we have a fast checkout, and a completely different
diff --git a/git/test/test_tree.py b/git/test/test_tree.py
index 982fa2e1..7edae577 100644
--- a/git/test/test_tree.py
+++ b/git/test/test_tree.py
@@ -13,6 +13,7 @@ from git.objects.fun import (
)
from cStringIO import StringIO
+
class TestTree(TestBase):
def test_serializable(self):
@@ -38,7 +39,6 @@ class TestTree(TestBase):
testtree._deserialize(stream)
assert testtree._cache == orig_cache
-
# TEST CACHE MUTATOR
mod = testtree.cache
self.failUnlessRaises(ValueError, mod.add, "invalid sha", 0, "name")
diff --git a/git/test/test_util.py b/git/test/test_util.py
index acca0928..ea62425b 100644
--- a/git/test/test_util.py
+++ b/git/test/test_util.py
@@ -17,6 +17,7 @@ import time
class TestIterableMember(object):
+
"""A member of an iterable list"""
__slots__ = ("name", "prefix_name")
@@ -26,6 +27,7 @@ class TestIterableMember(object):
class TestUtils(TestBase):
+
def setup(self):
self.testdict = {
"string": "42",
@@ -37,7 +39,6 @@ class TestUtils(TestBase):
assert_equal('this-is-my-argument', dashify('this_is_my_argument'))
assert_equal('foo', dashify('foo'))
-
def test_lock_file(self):
my_file = tempfile.mktemp()
lock_file = LockFile(my_file)