Skip to content

Commit a703e7b

Browse files
committed
Move NodeTree into backends sub-package
1 parent 32a0471 commit a703e7b

File tree

8 files changed

+13
-14
lines changed

8 files changed

+13
-14
lines changed

contextshell/backends/Filesystem.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
1-
from contextshell.TreeRoot import TreeRoot
1+
from contextshell.NodePath import NodePath
2+
from contextshell.TreeRoot import TreeRoot, ActionArgsPack
23
from contextshell.backends.Module import Module
34

45

56
class FilesystemRoot(TreeRoot):
6-
pass
7+
def __init__(self, root_directory_path: str):
8+
self.root_directory_path = root_directory_path
9+
10+
def execute(self, target: NodePath, action: NodePath, args: ActionArgsPack = None):
11+
pass
712

813

914
class FilesystemModule(Module):
File renamed without changes.

tests/functional/ActionResolvingTests.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
from contextshell.NodePath import NodePath
2-
from contextshell.TreeRoot import TreeRoot
3-
from contextshell.NodeTreeRoot import NodeTreeRoot
2+
from contextshell.backends.NodeTree import NodeTreeRoot
43
from tests.functional.TestExecutor import script_test
54
from tests.functional.ShellTestsBase import NodeTreeTestsBase
6-
import unittest
75

86

97
class ActionResolvingTests(NodeTreeTestsBase):

tests/functional/CustomTypeTests.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from contextshell.NodeTreeRoot import NodeTreeRoot
1+
from contextshell.backends.NodeTree import NodeTreeRoot
22
from tests.functional.ShellTestsBase import NodeTreeTestsBase
33
from tests.functional.TestExecutor import script_test
44
import unittest

tests/functional/FilesystemTests.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,17 @@
33
import tempfile
44
from contextshell.TreeRoot import TreeRoot
55
from contextshell.VirtualTree import VirtualTree
6-
from contextshell.NodeTreeRoot import NodeTreeRoot
7-
from contextshell.NodePath import NodePath
86
from tests.functional.ShellTestsBase import TreeRootTestsBase
97
from tests.functional.TestExecutor import script_test
108
from contextshell.backends.Filesystem import FilesystemRoot
11-
from contextshell.NodePath import NodePath as np
129

1310

1411
class FilesystemTestsBase(TreeRootTestsBase):
1512
test_directory_path = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'test_data')
1613

1714
def create_tree_root(self) -> TreeRoot:
1815
self.test_directory = tempfile.TemporaryDirectory(FilesystemTestsBase.__name__)
19-
# return FilesystemRoot(self.test_directory.name) # FIXME: make this work
20-
return None
16+
return FilesystemRoot(self.test_directory.name) # FIXME: make this work
2117

2218
def setUp(self):
2319
super().setUp()

tests/functional/ParserTypesTests.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import unittest
2-
from contextshell.NodeTreeRoot import NodeTreeRoot
2+
from contextshell.backends.NodeTree import NodeTreeRoot
33
from contextshell.NodePath import NodePath
44
from tests.functional.ShellTestsBase import NodeTreeTestsBase
55
from tests.functional.TestExecutor import script_test

tests/functional/ShellTestsBase.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
from contextshell.NodePath import NodePath
77
from contextshell.CommandInterpreter import CommandInterpreter
88
from contextshell.VirtualTree import VirtualTree
9-
from contextshell.NodeTreeRoot import NodeTreeRoot
9+
from contextshell.backends.NodeTree import NodeTreeRoot
1010

1111

1212
class ShellScriptTestsBase(unittest.TestCase, ABC):

tests/unit/NodeTreeRootTests.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55

66
def create_tree(*args, **kwargs):
7-
from contextshell.NodeTreeRoot import NodeTreeRoot
7+
from contextshell.backends.NodeTree import NodeTreeRoot
88
return NodeTreeRoot(*args)
99

1010

0 commit comments

Comments
 (0)