예제 #1
0
    def test_update_in_private_env_append_unlink(self, remove_actions):
        required_solves = [
            plan.SpecsForPrefix(prefix="root/prefix/envs/_env_",
                                specs=["test1", "test2"],
                                r=self.res),
            plan.SpecsForPrefix(prefix=context.root_prefix,
                                specs=["whatevs"],
                                r=self.res)
        ]

        action = defaultdict(list)
        action["PREFIX"] = "root/prefix/envs/_env_"
        action["LINK"] = [Dist("test1-2.1.4-1"), Dist("test2-1.1.1-8")]
        action_root = defaultdict(list)
        action_root["PREFIX"] = context.root_prefix
        action_root["LINK"] = [Dist("whatevs-54-54")]
        actions = [action, action_root]

        test_link_data = {context.root_prefix: {Dist("test1-2.1.4-1"): True}}
        with patch("conda.core.linked_data.linked_data_", test_link_data):
            plan.add_unlink_options_for_update(actions, required_solves,
                                               self.res.index)

        aug_action_root = defaultdict(list)
        aug_action_root["PREFIX"] = context.root_prefix
        aug_action_root["LINK"] = [Dist("whatevs-54-54")]
        aug_action_root["UNLINK"] = [Dist("test1-2.1.4-1")]
        expected_output = [action, aug_action_root]
        self.assertEquals(actions, expected_output)
예제 #2
0
    def test_update_in_private_env_add_remove_action(self, remove_actions):
        required_solves = [
            plan.SpecsForPrefix(prefix="root/prefix/envs/_env_",
                                specs=["test1", "test2"],
                                r=self.res),
            plan.SpecsForPrefix(prefix=context.root_dir,
                                specs=["test3"],
                                r=self.res)
        ]

        action = defaultdict(list)
        action["PREFIX"] = "root/prefix/envs/_env_"
        action["LINK"] = [Dist("test1-2.1.4-1"), Dist("test2-1.1.1-8")]
        actions = [action]

        test_link_data = {context.root_prefix: {Dist("test1-2.1.4-1"): True}}
        with patch("conda.core.linked_data.linked_data_", test_link_data):
            plan.add_unlink_options_for_update(actions, required_solves,
                                               self.res.index)

        expected_output = [
            action,
            generate_remove_action("root/prefix", [Dist("test1-2.1.4-1")])
        ]
        self.assertEquals(actions, expected_output)
예제 #3
0
    def test_update_in_root_env(self, prefix_if_in_private_env):
        required_solves = [plan.SpecsForPrefix(prefix=context.root_dir, specs=["test3", "test4"],
                                               r=self.res)]

        action = defaultdict(list)
        action["PREFIX"] = "root/prefix"
        action["LINK"] = [Dist("test3-1.2.0"), Dist("test4-1.2.1")]
        actions = [action]
        plan.add_unlink_options_for_update(actions, required_solves, self.index)
        expected_output = [action, generate_remove_action(
            "some/prefix/envs/_env_", [Dist("test3-1.2.0"), Dist("test4-2.1.0-22")])]
        self.assertEquals(actions, expected_output)
예제 #4
0
    def test_update_in_root_env(self, prefix_if_in_private_env):
        required_solves = [plan.SpecsForPrefix(prefix=context.root_dir, specs=["test3", "test4"],
                                               r=self.res)]

        action = defaultdict(list)
        action["PREFIX"] = "root/prefix"
        action["LINK"] = [Dist("test3-1.2.0"), Dist("test4-1.2.1")]
        actions = [action]
        plan.add_unlink_options_for_update(actions, required_solves, self.res.index)
        expected_output = [action, generate_remove_action(
            "some/prefix/envs/_env_", [Dist("test3-1.2.0"), Dist("test4-2.1.0-22")])]
        self.assertEquals(actions, expected_output)
예제 #5
0
    def test_update_in_private_env_add_remove_action(self, remove_actions):
        required_solves = [plan.SpecsForPrefix(prefix="root/prefix/envs/_env_",
                                               specs=["test1", "test2"], r=self.res),
                           plan.SpecsForPrefix(prefix=context.root_dir, specs=["test3"],
                                               r=self.res)]

        action = defaultdict(list)
        action["PREFIX"] = "root/prefix/envs/_env_"
        action["LINK"] = [Dist("test1-2.1.4-1"), Dist("test2-1.1.1-8")]
        actions = [action]

        test_link_data = {context.root_prefix: {Dist("test1-2.1.4-1"): True}}
        with patch("conda.core.linked_data.linked_data_", test_link_data):
            plan.add_unlink_options_for_update(actions, required_solves, self.index)

        expected_output = [action, generate_remove_action("root/prefix", [Dist("test1-2.1.4-1")])]
        self.assertEquals(actions, expected_output)
예제 #6
0
    def test_update_in_private_env_append_unlink(self, remove_actions):
        required_solves = [plan.SpecsForPrefix(prefix="root/prefix/envs/_env_",
                                               specs=["test1", "test2"], r=self.res),
                           plan.SpecsForPrefix(prefix=context.root_prefix, specs=["whatevs"],
                                               r=self.res)]

        action = defaultdict(list)
        action["PREFIX"] = "root/prefix/envs/_env_"
        action["LINK"] = [Dist("test1-2.1.4-1"), Dist("test2-1.1.1-8")]
        action_root = defaultdict(list)
        action_root["PREFIX"] = context.root_prefix
        action_root["LINK"] = [Dist("whatevs-54-54")]
        actions = [action, action_root]

        test_link_data = {context.root_prefix: {Dist("test1-2.1.4-1"): True}}
        with patch("conda.core.linked_data.linked_data_", test_link_data):
            plan.add_unlink_options_for_update(actions, required_solves, self.index)

        aug_action_root = defaultdict(list)
        aug_action_root["PREFIX"] = context.root_prefix
        aug_action_root["LINK"] = [Dist("whatevs-54-54")]
        aug_action_root["UNLINK"] = [Dist("test1-2.1.4-1")]
        expected_output = [action, aug_action_root]
        self.assertEquals(actions, expected_output)