8
8
from pylsp import uris
9
9
from pylsp .workspace import Document , Workspace
10
10
11
- from pyls_black .plugin import load_config , pyls_format_document , pyls_format_range
11
+ from pylsp_black .plugin import load_config , pylsp_format_document , pylsp_format_range
12
+
12
13
13
14
here = Path (__file__ ).parent
14
15
fixtures_dir = here / "fixtures"
@@ -62,8 +63,8 @@ def config_document(workspace):
62
63
return Document (uri , workspace )
63
64
64
65
65
- def test_pyls_format_document (unformatted_document , formatted_document ):
66
- result = pyls_format_document (unformatted_document )
66
+ def test_pylsp_format_document (unformatted_document , formatted_document ):
67
+ result = pylsp_format_document (unformatted_document )
67
68
68
69
assert result == [
69
70
{
@@ -77,7 +78,7 @@ def test_pyls_format_document(unformatted_document, formatted_document):
77
78
78
79
79
80
def test_pyls_format_pyi_document (unformatted_pyi_document , formatted_pyi_document ):
80
- result = pyls_format_document (unformatted_pyi_document )
81
+ result = pylsp_format_document (unformatted_pyi_document )
81
82
82
83
assert result == [
83
84
{
@@ -90,26 +91,26 @@ def test_pyls_format_pyi_document(unformatted_pyi_document, formatted_pyi_docume
90
91
]
91
92
92
93
93
- def test_pyls_format_document_unchanged (formatted_document ):
94
- result = pyls_format_document (formatted_document )
94
+ def test_pylsp_format_document_unchanged (formatted_document ):
95
+ result = pylsp_format_document (formatted_document )
95
96
96
97
assert result == []
97
98
98
99
99
100
def test_pyls_format_pyi_document_unchanged (formatted_pyi_document ):
100
- result = pyls_format_document (formatted_pyi_document )
101
+ result = pylsp_format_document (formatted_pyi_document )
101
102
102
103
assert result == []
103
104
104
105
105
- def test_pyls_format_document_syntax_error (invalid_document ):
106
- result = pyls_format_document (invalid_document )
106
+ def test_pylsp_format_document_syntax_error (invalid_document ):
107
+ result = pylsp_format_document (invalid_document )
107
108
108
109
assert result == []
109
110
110
111
111
- def test_pyls_format_document_with_config (config_document ):
112
- result = pyls_format_document (config_document )
112
+ def test_pylsp_format_document_with_config (config_document ):
113
+ result = pylsp_format_document (config_document )
113
114
114
115
assert result == [
115
116
{
@@ -134,13 +135,13 @@ def test_pyls_format_document_with_config(config_document):
134
135
("start" , "end" , "expected" ),
135
136
[(0 , 0 , 'a = "hello"\n ' ), (1 , 1 , "b = 42\n " ), (0 , 1 , 'a = "hello"\n b = 42\n ' )],
136
137
)
137
- def test_pyls_format_range (unformatted_document , start , end , expected ):
138
+ def test_pylsp_format_range (unformatted_document , start , end , expected ):
138
139
range = {
139
140
"start" : {"line" : start , "character" : 0 },
140
141
"end" : {"line" : end , "character" : 0 },
141
142
}
142
143
143
- result = pyls_format_range (unformatted_document , range = range )
144
+ result = pylsp_format_range (unformatted_document , range = range )
144
145
145
146
assert result == [
146
147
{
@@ -153,18 +154,18 @@ def test_pyls_format_range(unformatted_document, start, end, expected):
153
154
]
154
155
155
156
156
- def test_pyls_format_range_unchanged (formatted_document ):
157
+ def test_pylsp_format_range_unchanged (formatted_document ):
157
158
range = {"start" : {"line" : 0 , "character" : 0 }, "end" : {"line" : 1 , "character" : 0 }}
158
159
159
- result = pyls_format_range (formatted_document , range = range )
160
+ result = pylsp_format_range (formatted_document , range = range )
160
161
161
162
assert result == []
162
163
163
164
164
- def test_pyls_format_range_syntax_error (invalid_document ):
165
+ def test_pylsp_format_range_syntax_error (invalid_document ):
165
166
range = {"start" : {"line" : 0 , "character" : 0 }, "end" : {"line" : 1 , "character" : 0 }}
166
167
167
- result = pyls_format_range (invalid_document , range = range )
168
+ result = pylsp_format_range (invalid_document , range = range )
168
169
169
170
assert result == []
170
171
@@ -207,8 +208,8 @@ def test_load_config_defaults():
207
208
208
209
209
210
def test_entry_point ():
210
- distribution = pkg_resources .get_distribution ("pyls -black" )
211
- entry_point = distribution .get_entry_info ("pyls " , "pyls_black " )
211
+ distribution = pkg_resources .get_distribution ("python-lsp -black" )
212
+ entry_point = distribution .get_entry_info ("pylsp " , "pylsp_black " )
212
213
213
214
assert entry_point is not None
214
215
0 commit comments