def test_tool_requirements(): tool_requirements_ab = ToolRequirements([REQUIREMENT_A, REQUIREMENT_B]) tool_requirements_ab_dup = ToolRequirements([REQUIREMENT_A, REQUIREMENT_B]) tool_requirements_b = ToolRequirements([REQUIREMENT_A]) assert tool_requirements_ab == ToolRequirements( [REQUIREMENT_B, REQUIREMENT_A]) assert tool_requirements_ab == ToolRequirements( [REQUIREMENT_B, REQUIREMENT_A, REQUIREMENT_A]) assert tool_requirements_ab != tool_requirements_b assert len({tool_requirements_ab, tool_requirements_ab_dup}) == 1
def __init__(self, requirements=None, installed_tool_dependencies=None): requirements = requirements or ToolRequirements() if installed_tool_dependencies is None: installed_tool_dependencies = [] self.requirements = requirements # tool shed installed tool dependencies... self.installed_tool_dependencies = installed_tool_dependencies
def test_shell_commands_built(): # Test that dependency manager builds valid shell commands for a list of # requirements. with __test_base_path() as base_path: dm = __dependency_manager_for_base_path(default_base_path=base_path) __setup_galaxy_package_dep(base_path, TEST_REPO_NAME, TEST_VERSION, contents="export FOO=\"bar\"") mock_requirements = ToolRequirements([{ 'type': 'package', 'version': TEST_VERSION, 'name': TEST_REPO_NAME }]) commands = dm.dependency_shell_commands(mock_requirements) __assert_foo_exported(commands)