File: blabla_test_documentation.py

package info (click to toggle)
python-jedi 0.10.0~git1%2Bf05c071-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 2,064 kB
  • ctags: 3,014
  • sloc: python: 16,997; makefile: 149; ansic: 13
file content (30 lines) | stat: -rw-r--r-- 839 bytes parent folder | download
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
# todo probably remove test_integration_keyword

def test_keyword_doc():
    r = list(Script("or", 1, 1).goto_definitions())
    assert len(r) == 1
    assert len(r[0].doc) > 100

    r = list(Script("asfdasfd", 1, 1).goto_definitions())
    assert len(r) == 0

    k = Script("fro").completions()[0]
    imp_start = '\nThe ``import'
    assert k.raw_doc.startswith(imp_start)
    assert k.doc.startswith(imp_start)


def test_blablabla():
    defs = Script("import").goto_definitions()
    assert len(defs) == 1 and [1 for d in defs if d.doc]
    # unrelated to #44


def test_operator_doc(self):
    r = list(Script("a == b", 1, 3).goto_definitions())
    assert len(r) == 1
    assert len(r[0].doc) > 100

def test_lambda():
    defs = Script('lambda x: x', column=0).goto_definitions()
    assert [d.type for d in defs] == ['keyword']