Exemple #1
0
    def test_invalid_process_type(self):
        """`get_results` should raise `ValueError` if `CalcJobNode` has invalid `process_type`"""
        node = CalcJobNode(computer=self.computer, process_type='aiida.calculations:not_existent')
        manager = CalcJobResultManager(node)

        with self.assertRaises(ValueError):
            manager.get_results()
Exemple #2
0
    def test_no_process_type(self):
        """`get_results` should raise `ValueError` if `CalcJobNode` has no `process_type`"""
        node = CalcJobNode(computer=self.computer)
        manager = CalcJobResultManager(node)

        with self.assertRaises(ValueError):
            manager.get_results()
Exemple #3
0
def test_invalid_process_type(generate_calculation_node):
    """`get_results` should raise `ValueError` if `CalcJobNode` has invalid `process_type`"""
    node = generate_calculation_node(entry_point='aiida.calculations:invalid')
    manager = CalcJobResultManager(node)

    with pytest.raises(ValueError):
        manager.get_results()
Exemple #4
0
def test_no_process_type(generate_calculation_node):
    """`get_results` should raise `ValueError` if `CalcJobNode` has no `process_type`"""
    node = generate_calculation_node()
    manager = CalcJobResultManager(node)

    with pytest.raises(ValueError):
        manager.get_results()
Exemple #5
0
def test_process_class_no_default_node(generate_calculation_node):
    """`get_results` should raise `ValueError` if process class does not define default output node."""
    # This is a valid process class however ArithmeticAddCalculation does define a default output node
    node = generate_calculation_node(
        entry_point='aiida.calculations:arithmetic.add')
    manager = CalcJobResultManager(node)

    with pytest.raises(ValueError):
        manager.get_results()
Exemple #6
0
    def test_process_class_no_default_node(self):
        """`get_results` should raise `ValueError` if process class does not define default output node."""
        # This is a valid process class however ArithmeticAddCalculation does define a default output node
        process_class = CalculationFactory('arithmetic.add')
        process_type = get_entry_point_string_from_class(process_class.__module__, process_class.__name__)
        node = CalcJobNode(computer=self.computer, process_type=process_type)

        manager = CalcJobResultManager(node)

        with self.assertRaises(ValueError):
            manager.get_results()