Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mitogen
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
nexedi
mitogen
Commits
d17af194
Commit
d17af194
authored
Oct 01, 2017
by
David Wilson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix importer_test constructor signature.
parent
2454dcc9
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
7 deletions
+19
-7
tests/channel_test.py
tests/channel_test.py
+5
-1
tests/id_allocation_test.py
tests/id_allocation_test.py
+5
-1
tests/importer_test.py
tests/importer_test.py
+9
-5
No files found.
tests/channel_test.py
View file @
d17af194
...
...
@@ -4,7 +4,7 @@ import mitogen.core
import
testlib
class
ConstructorTest
(
testlib
.
RouterMixin
,
unittest
.
TestCase
):
class
ConstructorTest
(
testlib
.
RouterMixin
,
testlib
.
TestCase
):
def
test_constructor
(
self
):
# issue 32
l1
=
self
.
router
.
local
()
...
...
@@ -14,3 +14,7 @@ class ConstructorTest(testlib.RouterMixin, unittest.TestCase):
assert
chan
.
dst_handle
==
123
assert
chan
.
handle
is
not
None
assert
chan
.
handle
>
0
if
__name__
==
'__main__'
:
unittest
.
main
()
tests/id_allocation_test.py
View file @
d17af194
...
...
@@ -5,8 +5,12 @@ import testlib
import
id_allocation
class
SlaveTest
(
testlib
.
RouterMixin
,
unittest
.
TestCase
):
class
SlaveTest
(
testlib
.
RouterMixin
,
testlib
.
TestCase
):
def
test_slave_allocates_id
(
self
):
context
=
self
.
router
.
local
()
id_
=
context
.
call
(
id_allocation
.
allocate_an_id
)
assert
id_
==
(
self
.
router
.
id_allocator
.
next_id
-
1
)
if
__name__
==
'__main__'
:
unittest
.
main
()
tests/importer_test.py
View file @
d17af194
...
...
@@ -18,14 +18,14 @@ class ImporterMixin(testlib.RouterMixin):
def
setUp
(
self
):
super
(
ImporterMixin
,
self
).
setUp
()
self
.
context
=
mock
.
Mock
()
self
.
importer
=
mitogen
.
core
.
Importer
(
self
.
router
,
self
.
context
,
''
)
self
.
importer
=
mitogen
.
core
.
Importer
(
self
.
context
,
''
)
def
tearDown
(
self
):
sys
.
modules
.
pop
(
self
.
modname
,
None
)
super
(
ImporterMixin
,
self
).
tearDown
()
class
LoadModuleTest
(
ImporterMixin
,
unittest
.
TestCase
):
class
LoadModuleTest
(
ImporterMixin
,
testlib
.
TestCase
):
data
=
zlib
.
compress
(
"data = 1
\
n
\
n
"
)
path
=
'fake_module.py'
modname
=
'fake_module'
...
...
@@ -58,7 +58,7 @@ class LoadModuleTest(ImporterMixin, unittest.TestCase):
self
.
assertTrue
(
mod
.
__package__
is
None
)
class
LoadSubmoduleTest
(
ImporterMixin
,
unittest
.
TestCase
):
class
LoadSubmoduleTest
(
ImporterMixin
,
testlib
.
TestCase
):
data
=
zlib
.
compress
(
"data = 1
\
n
\
n
"
)
path
=
'fake_module.py'
modname
=
'mypkg.fake_module'
...
...
@@ -70,7 +70,7 @@ class LoadSubmoduleTest(ImporterMixin, unittest.TestCase):
self
.
assertEquals
(
mod
.
__package__
,
'mypkg'
)
class
LoadModulePackageTest
(
ImporterMixin
,
unittest
.
TestCase
):
class
LoadModulePackageTest
(
ImporterMixin
,
testlib
.
TestCase
):
data
=
zlib
.
compress
(
"func = lambda: 1
\
n
\
n
"
)
path
=
'fake_pkg/__init__.py'
modname
=
'fake_pkg'
...
...
@@ -115,7 +115,7 @@ class LoadModulePackageTest(ImporterMixin, unittest.TestCase):
self
.
assertEquals
(
mod
.
func
.
__module__
,
self
.
modname
)
class
EmailParseAddrSysTest
(
testlib
.
RouterMixin
,
unittest
.
TestCase
):
class
EmailParseAddrSysTest
(
testlib
.
RouterMixin
,
testlib
.
TestCase
):
@
pytest
.
fixture
(
autouse
=
True
)
def
initdir
(
self
,
caplog
):
self
.
caplog
=
caplog
...
...
@@ -125,3 +125,7 @@ class EmailParseAddrSysTest(testlib.RouterMixin, unittest.TestCase):
# while executing email.utils.parseaddr(). Ensure this needless
# roundtrip has not reappeared.
pass
if
__name__
==
'__main__'
:
unittest
.
main
()
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment