commit/galaxy-central: greg: Fix tool shed unit tests I broke with my last commit.
1 new commit in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/commits/99056011d2db/ Changeset: 99056011d2db User: greg Date: 2014-04-24 19:45:04 Summary: Fix tool shed unit tests I broke with my last commit. Affected #: 2 files diff -r ffafb6350791453b31c841e5462314bcd04ffa88 -r 99056011d2dbbfa64f8b9ab56871e1d4da279f69 test/unit/tool_shed_unit_tests/test_fabric_util.py --- a/test/unit/tool_shed_unit_tests/test_fabric_util.py +++ b/test/unit/tool_shed_unit_tests/test_fabric_util.py @@ -1,6 +1,5 @@ from contextlib import contextmanager -from tool_shed.galaxy_install.recipe.recipe_manager import EnvFileBuilder -from tool_shed.galaxy_install.tool_dependencies import fabric_util +from tool_shed.galaxy_install.tool_dependencies.recipe.recipe_manager import EnvFileBuilder def test_env_file_builder(): @@ -10,10 +9,10 @@ mock_return = dict(value=0) def mock_file_append( text, file_path, **kwds ): - added_lines.append(text) - return mock_return["value"] + added_lines.append( text ) + return mock_return[ "value" ] - with __mock_fabric_util_method("file_append", mock_file_append): + with __mock_env_file_builder_method( env_file_builder, "file_append", mock_file_append ): env_file_builder.append_line( name="PATH", action="prepend_to", value="/usr/bin/local/R" ) assert added_lines == [ "PATH=/usr/bin/local/R:$PATH; export PATH" ] assert env_file_builder.return_code == 0 @@ -37,10 +36,10 @@ ## Poor man's mocking. Need to get a real mocking library as real Galaxy development ## dependnecy. @contextmanager -def __mock_fabric_util_method(name, mock_method): - real_method = getattr(fabric_util, name) +def __mock_env_file_builder_method( env_file_builder, name, mock_method ): + real_method = getattr( env_file_builder, name ) try: - setattr(fabric_util, name, mock_method) + setattr( env_file_builder, name, mock_method ) yield finally: - setattr(fabric_util, name, real_method) + setattr( env_file_builder, name, real_method ) diff -r ffafb6350791453b31c841e5462314bcd04ffa88 -r 99056011d2dbbfa64f8b9ab56871e1d4da279f69 test/unit/tool_shed_unit_tests/test_td_common_util.py --- a/test/unit/tool_shed_unit_tests/test_td_common_util.py +++ b/test/unit/tool_shed_unit_tests/test_td_common_util.py @@ -4,7 +4,8 @@ from tool_shed.galaxy_install.tool_dependencies import fabric_util from tool_shed.galaxy_install.tool_dependencies import td_common_util -from tool_shed.galaxy_install.recipe.recipe_manager import EnvFileBuilder +from tool_shed.galaxy_install.tool_dependencies.recipe.recipe_manager import EnvFileBuilder + TEST_DEPENDENCIES_DIR = "/opt/galaxy/dependencies" TEST_INSTALL_DIR = "%s/test_install_dir" % TEST_DEPENDENCIES_DIR Repository URL: https://bitbucket.org/galaxy/galaxy-central/ -- This is a commit notification from bitbucket.org. You are receiving this because you have the service enabled, addressing the recipient of this email.
participants (1)
-
commits-noreply@bitbucket.org