FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
bpython/bpython/test/test_importcompletion.py at fancy-paste · bassdeveloper/bpython · GitHub
bassdeveloper
/
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
Wiki
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Wiki
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
34 lines (28 loc) · 1.29 KB
Breadcrumbs
bpython
/
bpython
/
test
/
test_importcompletion.py
Copy path
File metadata and controls
34 lines (28 loc) · 1.29 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
from
bpython
import
importcompletion
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
.
assertEqual
(
importcompletion
.
complete
(
10
,
'import zza'
), [
'zzabc'
,
'zzabd'
])
def
test_package_completion
(
self
):
self
.
assertEqual
(
importcompletion
.
complete
(
13
,
'import zzabc.'
), [
'zzabc.e'
,
'zzabc.f'
, ])
class
TestRealComplete
(
unittest
.
TestCase
):
@
classmethod
def
setUpClass
(
cls
):
[
_
for
_
in
importcompletion
.
find_iterator
]
__import__
(
'sys'
)
__import__
(
'os'
)
@
classmethod
def
tearDownClass
(
cls
):
importcompletion
.
find_iterator
=
importcompletion
.
find_all_modules
()
importcompletion
.
modules
=
set
()
def
test_from_attribute
(
self
):
self
.
assertEqual
(
importcompletion
.
complete
(
19
,
'from sys import arg'
), [
'argv'
])
def
test_from_attr_module
(
self
):
self
.
assertEqual
(
importcompletion
.
complete
(
9
,
'from os.p'
), [
'os.path'
])
def
test_from_package
(
self
):
self
.
assertEqual
(
importcompletion
.
complete
(
17
,
'from xml import d'
), [
'dom'
])
Back
|
FazBrowse Home
|
New Git URL