File tree Expand file tree Collapse file tree 1 file changed +11
-6
lines changed
tests/unit_tests/extrinsics Expand file tree Collapse file tree 1 file changed +11
-6
lines changed Original file line number Diff line number Diff line change 4
4
5
5
6
6
def test_format_error_message_with_right_error_message ():
7
- """Verify that error message from extrinsic response parses correctly."""
7
+ """Verify that an error message from extrinsic response parses correctly."""
8
8
# Prep
9
9
fake_error_message = {
10
10
"type" : "SomeType" ,
11
11
"name" : "SomeErrorName" ,
12
- "docs" : ["Some error description." ],
12
+ "docs" : [
13
+ "Some error description." ,
14
+ "I'm second part." ,
15
+ "Hah, I'm the last one." ,
16
+ ],
13
17
}
14
18
15
19
# Call
16
20
result = format_error_message (fake_error_message )
17
21
18
22
# Assertions
19
23
20
- assert "SomeType" in result
21
- assert "SomeErrorName" in result
22
- assert "Some error description." in result
24
+ assert (
25
+ result
26
+ == "Subtensor returned `SomeErrorName(SomeType)` error. This means: `Some error description. I'm second part. Hah, I'm the last one.`."
27
+ )
23
28
24
29
25
30
def test_format_error_message_with_empty_error_message ():
26
- """Verify that empty error message from extrinsic response parses correctly."""
31
+ """Verify that an empty error message from extrinsic response parses correctly."""
27
32
# Prep
28
33
fake_error_message = {}
29
34
You can’t perform that action at this time.
0 commit comments