Пример #1
0
    def test__move_target_retry(self):
        mock.patch(
            'chroma_agent.action_plugins.manage_targets.get_resource_location',
            side_effect=['', '', self.target_node]).start()

        self.assertEqual(
            manage_targets._move_target(self.target_disk, self.target_node),
            None)
        self.assertRanAllCommandsInOrder()
Пример #2
0
    def test__move_target_fail(self):
        mock.patch(
            'chroma_agent.action_plugins.manage_targets.get_resource_location',
            return_value='').start()

        self.assertEqual(
            manage_targets._move_target(self.target_disk, self.target_node),
            'Failed to move target %s to node %s' %
            (self.target_disk, self.target_node))
        self.assertRanAllCommandsInOrder()
Пример #3
0
    def test__move_target_retry(self):
        from chroma_agent.action_plugins import manage_targets

        mock.patch(
            "chroma_agent.action_plugins.manage_targets.get_resource_location",
            side_effect=["", "", self.target_node],
        ).start()

        self.assertEqual(
            manage_targets._move_target(self.target_disk, self.target_node), None
        )
        self.assertRanAllCommandsInOrder()
Пример #4
0
    def test__move_target_fail(self):
        from chroma_agent.action_plugins import manage_targets

        mock.patch(
            "chroma_agent.action_plugins.manage_targets.get_resource_location",
            return_value="",
        ).start()

        self.assertEqual(
            manage_targets._move_target(self.target_disk, self.target_node),
            "Failed to move target %s to node %s"
            % (self.target_disk, self.target_node),
        )
        self.assertRanAllCommandsInOrder()