Skip to content

Commit

Permalink
Fix call to 'bdist_egg' in the release command
Browse files Browse the repository at this point in the history
  • Loading branch information
fchauvel committed Aug 25, 2015
1 parent 9d4c730 commit 715da80
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
4 changes: 1 addition & 3 deletions flap/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,6 @@ def commit(self, message):
def tag(self, version):
command = ["git.exe", "tag", "-a", "v" + str(version), "-m", "\"Version %s\"" % str(version) ]
subprocess.call(command, env=self.environment, shell=True)
command = ["git.exe", "push", "--tag"]
subprocess.call(command, env=self.environment, shell=True)


class Release(Command):
Expand Down Expand Up @@ -149,7 +147,7 @@ def releasedVersion(self, currentVersion):
return releasedVersion

def build(self):
self.runCommand(bdist_egg)
self.run_command("bdist_egg")

def prepareNextRelease(self, releasedVersion):
newVersion = releasedVersion.nextMicroRelease()
Expand Down
11 changes: 5 additions & 6 deletions tests/unit/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,7 @@ def testTag(self):
with patch("subprocess.call", mock):
scm = SourceControl()
scm.tag(Version(2, 0, 1))
mock.assert_has_calls([call(["git.exe", "tag", "-a", "v2.0.1", "-m", "\"Version 2.0.1\""], env=ANY, shell=True),
call(["git.exe", "push", "--tag"], env=ANY, shell=True)])
mock.assert_has_calls([call(["git.exe", "tag", "-a", "v2.0.1", "-m", "\"Version 2.0.1\""], env=ANY, shell=True)])

class ReleaseTest(TestCase):

Expand All @@ -98,7 +97,7 @@ def createSourceWithVersion(self, text):

def release(self, sources, scm, kind):
release = Release(Distribution(), scm, sources)
release.runCommand = MagicMock()
release.run_command = MagicMock()
release.type = kind
release.run()
return release
Expand All @@ -115,7 +114,7 @@ def testMicroRelease(self):

release = self.release(sources, scm, "micro")

release.runCommand.assert_called_with(bdist_egg)
release.run_command.assert_called_with("bdist_egg")
scm.tag.assert_called_once_with(Version(1, 3, 3))
sources.readVersion.assert_called_once_with()
sources.writeVersion.assert_called_once_with(Version(1, 3, 4))
Expand All @@ -127,7 +126,7 @@ def testMinorRelease(self):

release = self.release(sources, scm, "minor")

release.runCommand.assert_called_with(bdist_egg)
release.run_command.assert_called_with("bdist_egg")
sources.readVersion.assert_called_once_with()
scm.tag.assert_called_once_with(Version(1, 4, 0))
sources.writeVersion.assert_has_calls([call(Version(1, 4, 0)), call(Version(1,4,1))])
Expand All @@ -141,7 +140,7 @@ def testMajorRelease(self):

release = self.release(sources, scm, "major")

release.runCommand.assert_called_with(bdist_egg)
release.run_command.assert_called_with("bdist_egg")
sources.readVersion.assert_called_once_with()
scm.tag.assert_called_once_with(Version(2, 0, 0))
sources.writeVersion.assert_has_calls([call(Version(2, 0, 0)), call(Version(2,0,1))])
Expand Down

0 comments on commit 715da80

Please sign in to comment.