This repository was archived by the owner on Mar 27, 2019. It is now read-only.
Repository navigation
Expand file tree
/
Copy pathpython_test.go
More file actions
104 lines (95 loc) · 2.87 KB
/
Copy pathpython_test.go
File metadata and controls
104 lines (95 loc) · 2.87 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
package main
import (
"testing"
"sourcegraph.com/sourcegraph/sourcegraph/pkg/lsp"
"github.com/sourcegraph/langserver/testharness"
)
func TestPython_hover(t *testing.T) {
testharness.RunHoverTests("langserver-python", &pythonTestData, t)
}
func TestPython_definition(t *testing.T) {
testharness.RunDefinitionTests("langserver-python", &pythonTestData, t)
}
func TestPython_references(t *testing.T) {
testharness.RunReferencesTests("langserver-python", &pythonTestData, t)
}
var pythonTestData = testharness.TestCase{
Repo: "github.com/jkbrzt/httpie",
HoverCases: []testharness.HoverCase{
testharness.HoverCase{
File: "httpie/cli.py",
Line: 25,
Character: 8,
Resp: lsp.Hover{
Contents: []lsp.MarkedString{
lsp.MarkedString{
Language: "text/plain",
Value: `HTTPieArgumentParser(self, *args, **kwargs)
Adds additional logic to ` + "`argparse.ArgumentParser`" + `.
Handles all input (CLI args, file args, stdin), applies defaults,
and performs extra validation.
`,
},
},
},
},
},
DefinitionCases: []testharness.DefinitionCase{
testharness.DefinitionCase{
File: "httpie/cli.py",
Line: 37,
Character: 20,
Resp: []lsp.Location{
lsp.Location{
URI: "file:///Users/rothfels/go/src/github.com/sourcegraph/langserver-python/test_repos/github.com/jkbrzt/httpie/httpie/cli.py", // TODO: use workspace-relative path
Range: lsp.Range{
Start: lsp.Position{
Line: 25,
Character: 6,
},
End: lsp.Position{
Line: 25, // TODO: should be range of entire function body
Character: 6, // TODO: should be range of entire function body
},
},
},
},
},
},
ReferencesCases: []testharness.ReferencesCase{
testharness.ReferencesCase{
File: "httpie/cli.py",
Line: 37,
Character: 20,
Resp: []lsp.Location{
// TODO: this should include the declaration; it doesn't.
lsp.Location{
URI: "file:///Users/rothfels/go/src/github.com/sourcegraph/langserver-python/test_repos/github.com/jkbrzt/httpie/httpie/cli.py", // TODO: use workspace-relative path
Range: lsp.Range{
Start: lsp.Position{
Line: 37,
Character: 14,
},
End: lsp.Position{
Line: 37, // TODO: should be range of entire function body
Character: 14, // TODO: should be range of entire function body
},
},
},
lsp.Location{
URI: "file:///Users/rothfels/go/src/github.com/sourcegraph/langserver-python/test_repos/github.com/jkbrzt/httpie/httpie/cli.py", // TODO: use workspace-relative path
Range: lsp.Range{
Start: lsp.Position{
Line: 44,
Character: 20,
},
End: lsp.Position{
Line: 44, // TODO: should be range of entire function body
Character: 20, // TODO: should be range of entire function body
},
},
},
},
},
},
}