Beispiel #1
0
    def test_force_destination_id_false_with_runner(self):
        """
        Test that it use the id from destination_id
        """
        _tool_label = '_unittest_tool'
        _dest_label = '_unittest_destination'

        _tool_spec = {
            _tool_label: {
                'force_destination_id': False,
                'runner': _dest_label
            }
        }

        TOOL_DESTINATIONS[_tool_label] = _tool_spec[_tool_label]

        result = '1cores_4.0G'
        tool_id = _tool_label

        tool_spec = _finalize_tool_spec(tool_id,
                                        '',
                                        tools_spec=TOOL_DESTINATIONS)
        name = name_it(tool_spec)

        self.assertEqual(name, result)
Beispiel #2
0
    def test_force_destination_id_default(self):
        """
        Test
        """
        _tool_label = '_unittest_tool'

        _tool_spec = {_tool_label: {}}

        TOOL_DESTINATIONS[_tool_label] = _tool_spec[_tool_label]

        result = '1cores_4.0G'
        tool_id = _tool_label

        tool_spec = _finalize_tool_spec(tool_id, self.td, [])
        name = name_it(tool_spec)

        self.assertEqual(name, result)
Beispiel #3
0
    def test_force_destination_id_false(self):
        """
        Test
        """
        _tool_label = '_unittest_tool'

        _tool_spec = {_tool_label: {'force_destination_id': False}}

        self.td[_tool_label] = _tool_spec[_tool_label]

        result = '1cores_4.0G'
        tool_id = _tool_label

        tool_spec = _finalize_tool_spec(tool_id, self.td, [])
        name = name_it(tool_spec)

        self.assertEqual(name, result)
Beispiel #4
0
    def test_force_destination_id_true(self):
        """
        Test that it use the id from destination_id
        """
        _tool_label = '_unittest_tool'

        _tool_spec = {_tool_label: {'force_destination_id': True}}

        self.td[_tool_label] = _tool_spec[_tool_label]

        result = FDID_PREFIX + DEFAULT_DESTINATION
        tool_id = _tool_label

        tool_spec = _finalize_tool_spec(tool_id, self.td, [])
        name = name_it(tool_spec)

        self.assertEqual(name, result)
Beispiel #5
0
    def test_force_destination_id_false(self):
        """
        Test
        """
        _tool_label = '_unittest_tool'

        _tool_spec = {_tool_label: {'force_destination_id': False}}

        TOOL_DESTINATIONS[_tool_label] = _tool_spec[_tool_label]

        result = '1cores_4.0G'
        tool_id = _tool_label

        tool_spec = _finalize_tool_spec(tool_id,
                                        '',
                                        tools_spec=TOOL_DESTINATIONS)
        name = name_it(tool_spec)

        self.assertEqual(name, result)
Beispiel #6
0
    def test_force_destination_id_true_with_runner(self):
        """
        Test that it use the id from destination_id
        """
        _tool_label = '_unittest_tool'
        _dest_label = '_unittest_destination'

        _tool_spec = {
            _tool_label: {
                'force_destination_id': True,
                'runner': _dest_label
            }
        }

        self.td[_tool_label] = _tool_spec[_tool_label]

        result = FDID_PREFIX + _dest_label
        tool_id = _tool_label

        tool_spec = _finalize_tool_spec(tool_id, self.td, [])
        name = name_it(tool_spec)

        self.assertEqual(name, result)