FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
bpython/bpython/test/test_filewatch.py at main · darrenatrealpython/bpython · GitHub
darrenatrealpython
/
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_filewatch.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
34 lines (26 loc) · 978 Bytes
Breadcrumbs
bpython
/
bpython
/
test
/
test_filewatch.py
Copy path
File metadata and controls
34 lines (26 loc) · 978 Bytes
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
import
os
import
unittest
try
:
import
watchdog
from
bpython
.
curtsiesfrontend
.
filewatch
import
ModuleChangedEventHandler
has_watchdog
=
True
except
ImportError
:
has_watchdog
=
False
from
unittest
import
mock
@
unittest
.
skipUnless
(
has_watchdog
,
"watchdog required"
)
class
TestModuleChangeEventHandler
(
unittest
.
TestCase
):
def
setUp
(
self
):
self
.
module
=
ModuleChangedEventHandler
([],
1
)
self
.
module
.
observer
=
mock
.
Mock
()
def
test_create_module_handler
(
self
):
self
.
assertIsInstance
(
self
.
module
,
ModuleChangedEventHandler
)
def
test_add_module
(
self
):
self
.
module
.
_add_module
(
"something/test.py"
)
self
.
assertIn
(
os
.
path
.
abspath
(
"something/test"
),
self
.
module
.
dirs
[
os
.
path
.
abspath
(
"something"
)],
)
def
test_activate_throws_error_when_already_activated
(
self
):
self
.
module
.
activated
=
True
with
self
.
assertRaises
(
ValueError
):
self
.
module
.
activate
()
Back
|
FazBrowse Home
|
New Git URL