Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
Zope
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
Zope
Commits
fbb3b96d
Commit
fbb3b96d
authored
Apr 03, 2010
by
Tres Seaver
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add tests for App.Extensions.FuncCode
parent
458c1882
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
57 additions
and
0 deletions
+57
-0
src/App/tests/test_Extensions.py
src/App/tests/test_Extensions.py
+57
-0
No files found.
src/App/tests/test_Extensions.py
0 → 100644
View file @
fbb3b96d
##############################################################################
#
# Copyright (c) 2010 Zope Foundation and Contributors.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
# FOR A PARTICULAR PURPOSE
#
##############################################################################
""" Unit tests for App.Extensions module
"""
import
unittest
class
FuncCodeTests
(
unittest
.
TestCase
):
def
_getTargetClass
(
self
):
from
App.Extensions
import
FuncCode
return
FuncCode
def
_makeOne
(
self
,
f
,
im
=
0
):
return
self
.
_getTargetClass
()(
f
,
im
)
def
test_ctor_not_method_no_args
(
self
):
def
f
():
pass
fc
=
self
.
_makeOne
(
f
)
self
.
assertEqual
(
fc
.
co_varnames
,
())
self
.
assertEqual
(
fc
.
co_argcount
,
0
)
def
test_ctor_not_method_w_args
(
self
):
def
f
(
a
,
b
):
pass
fc
=
self
.
_makeOne
(
f
)
self
.
assertEqual
(
fc
.
co_varnames
,
(
'a'
,
'b'
))
self
.
assertEqual
(
fc
.
co_argcount
,
2
)
def
test_ctor_w_method_no_args
(
self
):
def
f
(
self
):
pass
fc
=
self
.
_makeOne
(
f
,
im
=
1
)
self
.
assertEqual
(
fc
.
co_varnames
,
())
self
.
assertEqual
(
fc
.
co_argcount
,
0
)
def
test_ctor_w_method_w_args
(
self
):
def
f
(
self
,
a
,
b
):
pass
fc
=
self
.
_makeOne
(
f
,
im
=
1
)
self
.
assertEqual
(
fc
.
co_varnames
,
(
'a'
,
'b'
))
self
.
assertEqual
(
fc
.
co_argcount
,
2
)
def
test_suite
():
return
unittest
.
TestSuite
((
unittest
.
makeSuite
(
FuncCodeTests
),
))
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