Skip to content

Commit 1d44cc7

Browse files
committed
Replace symbol indicating command in functional tests
1 parent 0f4daf5 commit 1d44cc7

File tree

6 files changed

+59
-61
lines changed

6 files changed

+59
-61
lines changed

tests/functional/ActionResolvingTests.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,41 +25,41 @@ def partial_action(tree: TreeRoot, target: NodePath, action: NodePath):
2525
@script_test
2626
def test_unknown_action(self):
2727
"""
28-
> .: unknown_action
28+
$ .: unknown_action
2929
NameError: Could not find action named 'unknown_action'
3030
"""
3131

3232
@script_test
3333
def test_parent_action_from_child(self):
3434
"""
35-
> .child: parent_action
35+
$ .child: parent_action
3636
PARENT
3737
"""
3838

3939
@script_test
4040
def test_child_action_from_child(self):
4141
"""
42-
> .child: child_action
42+
$ .child: child_action
4343
CHILD
4444
"""
4545

4646
@script_test
4747
def test_parent_action_from_parent(self):
4848
"""
49-
> .: parent_action
49+
$ .: parent_action
5050
PARENT
5151
"""
5252

5353
@script_test
5454
def test_child_action_from_parent(self):
5555
"""
56-
> .: child_action
56+
$ .: child_action
5757
NameError: Could not find action named 'child_action'
5858
"""
5959

6060
@script_test
6161
def test_non_action_invoke(self):
6262
"""
63-
> .: partial
63+
$ .: partial
6464
NameError: Could not find action named 'partial'
6565
"""

tests/functional/CrudTests.py

Lines changed: 36 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,16 @@ class CreateTests(CrudTestsBase):
1313
@script_test
1414
def test_create(self):
1515
"""
16-
> .: create foo
17-
> .: exists foo
16+
$ .: create foo
17+
$ .: exists foo
1818
True
1919
"""
2020

2121
@script_test
2222
def test_create_many_parts(self):
2323
"""
24-
> .: create foo.bar
25-
> .: exists foo.bar
24+
$ .: create foo.bar
25+
$ .: exists foo.bar
2626
True
2727
"""
2828

@@ -31,7 +31,7 @@ class ExistsTests(CrudTestsBase):
3131
@script_test
3232
def test_exists_nonexistent(self):
3333
"""
34-
> .: exists unknown
34+
$ .: exists unknown
3535
False
3636
"""
3737

@@ -40,15 +40,15 @@ class GetTests(CrudTestsBase):
4040
@script_test
4141
def test_get_existing(self):
4242
"""
43-
> .: create foo 1
44-
> .foo: get
43+
$ .: create foo 1
44+
$ .foo: get
4545
1
4646
"""
4747

4848
@script_test
4949
def test_get_nonexistent(self):
5050
"""
51-
> .foo: get
51+
$ .foo: get
5252
NameError: '.foo' doesn't exists
5353
"""
5454

@@ -57,32 +57,32 @@ class SetTests(CrudTestsBase):
5757
@script_test
5858
def test_set_existing(self):
5959
"""
60-
> .: create foo 1
61-
> .foo: set 2
62-
> .foo: get
60+
$ .: create foo 1
61+
$ .foo: set 2
62+
$ .foo: get
6363
2
6464
"""
6565

6666
@script_test
6767
def test_set_nonexistent(self):
6868
"""
69-
> .foo: set 1
69+
$ .foo: set 1
7070
NameError: '.foo' doesn't exists
7171
"""
7272

7373
@script_test
7474
def test_set_no_new_value(self):
7575
"""
76-
> .: create foo 1
77-
> .foo: set
76+
$ .: create foo 1
77+
$ .foo: set
7878
TypeError: set_action() missing 1 required positional argument: 'new_value'
7979
"""
8080

8181
@script_test
8282
def test_set_different_type(self):
8383
"""
84-
> .: create foo 2
85-
> .foo: set "rabarbar"
84+
$ .: create foo 2
85+
$ .foo: set "rabarbar"
8686
TypeError: Cannot assign value with type 'str' to 'int' node
8787
"""
8888

@@ -91,54 +91,52 @@ class ListTests(CrudTestsBase):
9191
@script_test
9292
def test_list_empty(self):
9393
"""
94-
> .: create foo
95-
> .foo: list
94+
$ .: create foo
95+
$ .foo: list
9696
"""
9797

9898
@script_test
9999
def test_list_in_creation_order(self):
100100
"""
101-
> .: create foo.Z_first
102-
> .: create foo.A_second
103-
> .foo: list
101+
$ .: create foo.Z_first
102+
$ .: create foo.A_second
103+
$ .foo: list
104104
Z_first
105105
A_second
106106
"""
107107

108108
@script_test
109109
def test_list_only_attributes(self):
110110
"""
111-
> .: create .test.@attr
112-
> .: create .test.key
113-
> .test: list.attributes
111+
$ .: create .test.@attr
112+
$ .: create .test.key
113+
$ .test: list.attributes
114114
@attr
115115
"""
116116

117117
@script_test
118118
def test_list_all(self):
119119
"""
120-
> .: create .test.@attr
121-
> .: create .test.key
122-
> .test: list.all
120+
$ .: create .test.@attr
121+
$ .: create .test.key
122+
$ .test: list.all
123123
@attr
124124
key
125125
"""
126126

127127
@script_test
128128
def test_list_only_normal(self):
129129
"""
130-
> .: create .test.@attr
131-
> .: create .test.key
132-
> .test: list
130+
$ .: create .test.@attr
131+
$ .: create .test.key
132+
$ .test: list
133133
key
134134
"""
135135

136-
137-
class ListActionsTests(CrudTestsBase):
138136
@script_test
139-
def test_list_action(self):
137+
def test_list_actions(self):
140138
"""
141-
> .: list.actions
139+
$ .: list.actions
142140
create
143141
exists
144142
get
@@ -152,15 +150,15 @@ class RemoveTests(CrudTestsBase):
152150
@script_test
153151
def test_remove_existing(self):
154152
"""
155-
> .: create foo
156-
> .foo: remove
157-
> .: exists foo
153+
$ .: create foo
154+
$ .foo: remove
155+
$ .: exists foo
158156
False
159157
"""
160158

161159
@script_test
162160
def test_remove_nonexistent(self):
163161
"""
164-
> .foo: remove
162+
$ .foo: remove
165163
NameError: '.foo' doesn't exists
166164
"""

tests/functional/FilesystemTests.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ def install_custom_actions(self, finder):
1414
@script_test
1515
def test_mount(self):
1616
"""
17-
> .: filesystem.mount.as .fs
18-
> .fs: exists
17+
$ .: filesystem.mount.as .fs
18+
$ .fs: exists
1919
True
2020
"""

tests/functional/ParserTypesTests.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,35 +15,35 @@ def type_of(tree: NodeTreeRoot, target: NodePath, action: NodePath, value):
1515
@script_test
1616
def test_int(self):
1717
"""
18-
> .: type.of 123
18+
$ .: type.of 123
1919
int
2020
"""
2121

2222
@script_test
2323
def test_double_quoted_string(self):
2424
"""
25-
> .: type.of "rabarbar"
25+
$ .: type.of "rabarbar"
2626
str
2727
"""
2828

2929
@script_test
3030
def test_single_quoted_string(self):
3131
"""
32-
> .: type.of 'rabarbar'
32+
$ .: type.of 'rabarbar'
3333
str
3434
"""
3535

3636
@script_test
3737
def test_float(self):
3838
"""
39-
> .: type.of 3.1415
39+
$ .: type.of 3.1415
4040
float
4141
"""
4242

4343
@unittest.skip("Not sure if required")
4444
@script_test
4545
def test_path(self):
4646
"""
47-
> .: type.of ra.bar.bar
47+
$ .: type.of ra.bar.bar
4848
NodePath
4949
"""

tests/functional/ScriptSanityTests.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ def test_single_command_no_output(self):
2727
shell = FakeShell()
2828
exec = create_executor(shell)
2929

30-
exec.test("> .: action")
30+
exec.test("$ .: action")
3131

3232
self.assertIn(".: action", shell.executed_commands)
3333

@@ -38,8 +38,8 @@ def test_multiple_commands_no_output(self):
3838
exec = create_executor(shell)
3939

4040
exec.test("""
41-
> foo
42-
> bar
41+
$ foo
42+
$ bar
4343
""")
4444

4545
self.assertSequenceEqual([
@@ -53,7 +53,7 @@ def test_single_command_output_matches(self):
5353
exec = create_executor(shell)
5454

5555
exec.test("""
56-
> .: action
56+
$ .: action
5757
bar
5858
""")
5959

@@ -63,7 +63,7 @@ def test_single_command_multiline_output_matches(self):
6363
exec = create_executor(shell)
6464

6565
exec.test("""
66-
> .: action
66+
$ .: action
6767
bar
6868
spam
6969
""")
@@ -75,7 +75,7 @@ def test_single_command_different_output(self):
7575

7676
with self.assertRaises(AssertionError):
7777
exec.test("""
78-
> .: action
78+
$ .: action
7979
foo
8080
""")
8181

@@ -86,7 +86,7 @@ def test_single_command_multiline_output_differs(self):
8686

8787
with self.assertRaises(AssertionError):
8888
exec.test("""
89-
> .: action
89+
$ .: action
9090
bar
9191
gruz
9292
""")
@@ -97,4 +97,4 @@ def test_single_command_unexpected_output(self):
9797
exec = create_executor(shell)
9898

9999
with self.assertRaises(AssertionError):
100-
exec.test("> .: action")
100+
exec.test("$ .: action")

tests/functional/TestExecutor.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,15 @@ def _parse_script(self, script_text: str) -> List[Tuple[str, str]]:
2626
i = 0
2727
while i < len(script_lines):
2828
line = script_lines[i]
29-
if not line.startswith('>'):
29+
if not line.startswith('$'):
3030
raise ValueError("Expected command but got output in tests script")
3131
command = line[1:].strip()
3232
i += 1
3333

3434
output_lines = []
3535
while i < len(script_lines):
3636
line = script_lines[i]
37-
if line.startswith('>'):
37+
if line.startswith('$'):
3838
break
3939
output_lines.append(line)
4040
i += 1

0 commit comments

Comments
 (0)