Skip to content

Commit

Permalink
Add test
Browse files Browse the repository at this point in the history
  • Loading branch information
mbercx committed Feb 12, 2024
1 parent 4ede7a1 commit 71f6591
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion tests/workflows/ph/test_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"""Tests for the `PhBaseWorkChain` class."""
from aiida import orm
from aiida.common import AttributeDict, LinkType
from aiida.engine import ProcessHandlerReport
from aiida.engine import ProcessHandlerReport, WorkChain
import pytest

from aiida_quantumespresso.calculations.ph import PhCalculation
Expand Down Expand Up @@ -257,3 +257,23 @@ def test_merge_outputs(
outputs = ph_base.get_outputs(node_2)

data_regression.check(outputs['output_parameters'].get_dict())


def test_validate_inputs_excluded_qpoints_distance(generate_inputs_ph):
"""Test that q-points validation passes in case the ports are excluded in a parent work chain."""
from aiida.engine.utils import instantiate_process
from aiida.manage.manager import get_manager

class WrapPhBaseWorkChain(WorkChain):
"""Minimal work chain that wraps a ``PhBaseWorkChain`` for testing excluding q-points inputs."""

@classmethod
def define(cls, spec):
super().define(spec)
spec.expose_inputs(PhBaseWorkChain, exclude=('qpoints', 'qpoints_distance'))

inputs = {'ph': generate_inputs_ph()}
inputs['ph'].pop('qpoints', None)
inputs['ph'].pop('qpoints_distance', None)
runner = get_manager().get_runner()
instantiate_process(runner, WrapPhBaseWorkChain, **inputs)

0 comments on commit 71f6591

Please sign in to comment.