Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Latest commit

 

History

History
History
34 lines (26 loc) · 978 Bytes

File metadata and controls

34 lines (26 loc) · 978 Bytes
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()
Morty Proxy This is a proxified and sanitized view of the page, visit original site.