FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
bpython/bpython/test/test_importcompletion.py at master · flyingfishfuse/bpython · GitHub
flyingfishfuse
/
bpython
Public
forked from
bpython/bpython
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
bpython
/
bpython
/
test
/
test_importcompletion.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
61 lines (48 loc) · 1.62 KB
Breadcrumbs
bpython
/
bpython
/
test
/
test_importcompletion.py
Copy path
File metadata and controls
61 lines (48 loc) · 1.62 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
# encoding: utf-8
from
__future__
import
unicode_literals
from
bpython
import
importcompletion
from
bpython
.
test
import
unittest
class
TestSimpleComplete
(
unittest
.
TestCase
):
def
setUp
(
self
):
self
.
original_modules
=
importcompletion
.
modules
importcompletion
.
modules
=
[
"zzabc"
,
"zzabd"
,
"zzefg"
,
"zzabc.e"
,
"zzabc.f"
,
]
def
tearDown
(
self
):
importcompletion
.
modules
=
self
.
original_modules
def
test_simple_completion
(
self
):
self
.
assertSetEqual
(
importcompletion
.
complete
(
10
,
"import zza"
),
set
([
"zzabc"
,
"zzabd"
])
)
def
test_package_completion
(
self
):
self
.
assertSetEqual
(
importcompletion
.
complete
(
13
,
"import zzabc."
),
set
([
"zzabc.e"
,
"zzabc.f"
]),
)
class
TestRealComplete
(
unittest
.
TestCase
):
@
classmethod
def
setUpClass
(
cls
):
for
_
in
importcompletion
.
find_iterator
:
pass
__import__
(
"sys"
)
__import__
(
"os"
)
@
classmethod
def
tearDownClass
(
cls
):
importcompletion
.
find_iterator
=
importcompletion
.
find_all_modules
()
importcompletion
.
modules
=
set
()
def
test_from_attribute
(
self
):
self
.
assertSetEqual
(
importcompletion
.
complete
(
19
,
"from sys import arg"
),
set
([
"argv"
])
)
def
test_from_attr_module
(
self
):
self
.
assertSetEqual
(
importcompletion
.
complete
(
9
,
"from os.p"
),
set
([
"os.path"
])
)
def
test_from_package
(
self
):
self
.
assertSetEqual
(
importcompletion
.
complete
(
17
,
"from xml import d"
),
set
([
"dom"
])
)
Back
|
FazBrowse Home
|
New Git URL