Skip to content

Commit

Permalink
Merge 2141e35 into da222bb
Browse files Browse the repository at this point in the history
  • Loading branch information
arcivanov committed May 9, 2016
2 parents da222bb + 2141e35 commit 27d18d5
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
Expand Up @@ -438,7 +438,7 @@ def build_entry_points_string(project):

for k in sorted(entry_points.keys()):
result += " " * (indent + 4)
result += "'%s': %s" % (k, build_string_from_array(entry_points[k], indent + 8)) + ",\n"
result += "'%s': %s" % (k, build_string_from_array(as_list(entry_points[k]), indent + 8)) + ",\n"

result = result[:-2] + "\n"
result += (" " * indent) + "}"
Expand Down
16 changes: 13 additions & 3 deletions src/unittest/python/plugins/python/distutils_plugin_tests.py
Expand Up @@ -25,8 +25,6 @@

import unittest

from test_utils import patch, MagicMock, ANY

from pybuilder.core import Project, Author, Logger
from pybuilder.errors import BuildFailedException
from pybuilder.pip_utils import PIP_EXEC_STANZA
Expand All @@ -48,7 +46,11 @@
build_string_from_array,
_run_process_and_wait,
)
from test_utils import PyBuilderTestCase
from test_utils import (PyBuilderTestCase,
patch,
MagicMock,
ANY
)


class InstallDependenciesTest(unittest.TestCase):
Expand Down Expand Up @@ -537,6 +539,14 @@ def test_should_render_entry_points_when_property_is_set(self):
" ]\n"
" }", actual_setup_script)

def test_should_render_single_entry_pointproperty_is_set(self):
self.project.set_property("distutils_entry_points", {'foo_entry': "release = zest.releaser.release:main"})

actual_setup_script = build_entry_points_string(self.project)
self.assertEquals("{\n"
" 'foo_entry': ['release = zest.releaser.release:main']\n"
" }", actual_setup_script)

def test_should_fail_with_entry_points_and_console_scripts_set(self):
self.project.set_property("distutils_console_scripts", object())
self.project.set_property("distutils_entry_points", object())
Expand Down

0 comments on commit 27d18d5

Please sign in to comment.