Skip to content

Commit

Permalink
[PEP8][SPELL] node generators in core module
Browse files Browse the repository at this point in the history
  • Loading branch information
bclenet committed Jan 25, 2024
1 parent 6f2047c commit 2cb35a3
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions tests/core/test_nodes.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,12 @@
pytest -q test_nodes.py -k <selected_test>
"""

from pytest import mark, raises
from pytest import mark

from nipype import Node
from nipype.interfaces.utility import Select, Function

import narps_open.core.nodes as nd
from narps_open.core.common import remove_directory, remove_file
from narps_open.core import nodes

class TestNodeCreator:
""" A class that contains all the unit tests for the NodeCreator class."""
Expand All @@ -28,8 +27,12 @@ def test_create_node():
""" Test the create_node method """

# Define another child for NodeCreator
class ValidNC(nd.NodeCreator):
class ValidNC(nodes.NodeCreator):
""" A valid implementation of a NodeCreator """

@staticmethod
def create_node(name: str) -> Node:
""" Return a Node, as expected """
return Node(Select(), name = name)

# Test it can be instantiated
Expand All @@ -46,7 +49,7 @@ class TestRemoveDirectoryNodeCreator:
def test_create_node():
""" Test the create_node method """

test_node = nd.RemoveDirectoryNodeCreator.create_node('node_name')
test_node = nodes.RemoveDirectoryNodeCreator.create_node('node_name')
assert isinstance(test_node, Node)
assert isinstance(test_node.interface, Function)
assert test_node.name == 'node_name'
Expand All @@ -59,7 +62,7 @@ class TestRemoveFileNodeCreator:
def test_create_node():
""" Test the create_node method """

test_node = nd.RemoveFileNodeCreator.create_node('node_name')
test_node = nodes.RemoveFileNodeCreator.create_node('node_name')
assert isinstance(test_node, Node)
assert isinstance(test_node.interface, Function)
assert test_node.name == 'node_name'

0 comments on commit 2cb35a3

Please sign in to comment.