Skip to content

Commit

Permalink
Make flake8 happy
Browse files Browse the repository at this point in the history
  • Loading branch information
agateau committed Nov 30, 2016
1 parent dbbc154 commit 9a2fae9
Showing 1 changed file with 13 additions and 30 deletions.
43 changes: 13 additions & 30 deletions yokadi/tests/gitvcsimpltestcase.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def createGitRepository(repoParentDir, name):
repoDir = join(repoParentDir, name)
os.mkdir(repoDir)
subprocess.check_call(("git", "init", "--quiet"), cwd=repoDir)
emptyPath = touch(repoDir, "EMPTY")
touch(repoDir, "EMPTY")
subprocess.check_call(("git", "add", "EMPTY"), cwd=repoDir)
subprocess.check_call(("git", "commit", "--quiet", "--message", "Init"), cwd=repoDir)
return repoDir
Expand Down Expand Up @@ -75,7 +75,7 @@ def createGitRepositoryWithConflict(tmpDir, path, ancestorContent="", localConte
remoteImpl.commitAll()

# Clone it
repoDir = join(tmpDir,path)
repoDir = join(tmpDir, path)
impl = GitVcsImpl()
impl.setDir(repoDir)
impl.clone(remoteRepoDir)
Expand Down Expand Up @@ -213,7 +213,6 @@ def testCloneNoGitUserInfo(self):
touch(repoDir, "bar")
impl.commitAll()


def testPull(self):
with TemporaryDirectory() as tmpDir:
remoteRepoDir = createGitRepository(tmpDir, "remote")
Expand Down Expand Up @@ -248,16 +247,12 @@ def testHasConflicts_noConflicts(self):

def testHasConflicts_conflicts(self):
with TemporaryDirectory() as tmpDir:
impl = createGitRepositoryWithConflict(tmpDir, "repo",
localContent="local",
remoteContent="remote")
impl = createGitRepositoryWithConflict(tmpDir, "repo", localContent="local", remoteContent="remote")
self.assertTrue(impl.hasConflicts())

def testGetConflicts(self):
with TemporaryDirectory() as tmpDir:
impl = createGitRepositoryWithConflict(tmpDir, "repo",
localContent="local",
remoteContent="remote")
impl = createGitRepositoryWithConflict(tmpDir, "repo", localContent="local", remoteContent="remote")

conflicts = list(impl.getConflicts())
self.assertEqual(len(conflicts), 1)
Expand All @@ -269,9 +264,7 @@ def testGetConflicts(self):

def testGetConflictsRemovedLocally(self):
with TemporaryDirectory() as tmpDir:
impl = createGitRepositoryWithConflict(tmpDir, "repo",
localContent=None,
remoteContent="remote")
impl = createGitRepositoryWithConflict(tmpDir, "repo", localContent=None, remoteContent="remote")

conflicts = list(impl.getConflicts())
self.assertEqual(len(conflicts), 1)
Expand All @@ -283,9 +276,7 @@ def testGetConflictsRemovedLocally(self):

def testGetConflictsRemovedRemotely(self):
with TemporaryDirectory() as tmpDir:
impl = createGitRepositoryWithConflict(tmpDir, "repo",
localContent="local",
remoteContent=None)
impl = createGitRepositoryWithConflict(tmpDir, "repo", localContent="local", remoteContent=None)

conflicts = list(impl.getConflicts())
self.assertEqual(len(conflicts), 1)
Expand All @@ -298,9 +289,7 @@ def testGetConflictsRemovedRemotely(self):
def testGetConflictsBothAdded(self):
with TemporaryDirectory() as tmpDir:
impl = createGitRepositoryWithConflict(tmpDir, "repo",
ancestorContent=None,
localContent="local",
remoteContent="remote")
ancestorContent=None, localContent="local", remoteContent="remote")

conflicts = list(impl.getConflicts())
self.assertEqual(len(conflicts), 1)
Expand All @@ -312,9 +301,7 @@ def testGetConflictsBothAdded(self):

def testCloseConflict_withContent(self):
with TemporaryDirectory() as tmpDir:
impl = createGitRepositoryWithConflict(tmpDir, "repo",
localContent="local",
remoteContent=None)
impl = createGitRepositoryWithConflict(tmpDir, "repo", localContent="local", remoteContent=None)

conflicts = list(impl.getConflicts())
self.assertEqual(len(conflicts), 1)
Expand All @@ -329,9 +316,7 @@ def testCloseConflict_withContent(self):

def testCloseConflict_withoutContent(self):
with TemporaryDirectory() as tmpDir:
impl = createGitRepositoryWithConflict(tmpDir, "repo",
localContent="local",
remoteContent=None)
impl = createGitRepositoryWithConflict(tmpDir, "repo", localContent="local", remoteContent=None)

conflicts = list(impl.getConflicts())
self.assertEqual(len(conflicts), 1)
Expand All @@ -346,9 +331,7 @@ def testCloseConflict_withoutContent(self):

def testAbortMerge(self):
with TemporaryDirectory() as tmpDir:
impl = createGitRepositoryWithConflict(tmpDir, "repo",
remoteContent="hello",
localContent="world")
impl = createGitRepositoryWithConflict(tmpDir, "repo", remoteContent="hello", localContent="world")
conflicts = set(impl.getConflicts())
self.assertEqual(len(conflicts), 1)
impl.abortMerge()
Expand Down Expand Up @@ -471,7 +454,7 @@ def testGetWorkTreeChanges(self):
removedPath = touch(repoDir, "removed")
impl.commitAll()

addedPath = touch(repoDir, "added")
touch(repoDir, "added")

changes = impl.getWorkTreeChanges()
self.assertEqual(changes.modified, set())
Expand Down Expand Up @@ -503,7 +486,7 @@ def testPushOK(self):
impl.clone(remoteRepoDir)

# Make a change
fooPath = touch(repoDir, "foo")
touch(repoDir, "foo")
impl.commitAll()

# Push
Expand All @@ -516,7 +499,7 @@ def testPushNoRemote(self):
impl.setDir(repoDir)

# Make a change
fooPath = touch(repoDir, "foo")
touch(repoDir, "foo")
impl.commitAll()

# Push
Expand Down

0 comments on commit 9a2fae9

Please sign in to comment.