Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
SaQC
Manage
Activity
Members
Labels
Plan
Issues
36
Issue boards
Milestones
Wiki
Code
Merge requests
8
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
rdm-software
SaQC
Commits
5ccd9b25
Commit
5ccd9b25
authored
2 years ago
by
Bert Palm
🎇
Browse files
Options
Downloads
Patches
Plain Diff
added basic call-redirect test for core.modules
parent
1853e3a7
No related branches found
No related tags found
1 merge request
!462
More tests
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
saqc/lib/types.py
+2
-2
2 additions, 2 deletions
saqc/lib/types.py
tests/core/test_FunctionsMixin.py
+28
-0
28 additions, 0 deletions
tests/core/test_FunctionsMixin.py
with
30 additions
and
2 deletions
saqc/lib/types.py
+
2
−
2
View file @
5ccd9b25
...
...
@@ -32,7 +32,7 @@ ExternalFlag = Union[str, float, int]
# needed for deeper type hinting magic
class
CurveFitter
(
Protocol
):
def
__call__
(
self
,
data
:
np
.
ndarray
,
*
params
:
float
)
->
np
.
ndarray
:
...
...
# pragma: no cover
class
GenericFunction
(
Protocol
):
...
...
@@ -41,7 +41,7 @@ class GenericFunction(Protocol):
__globals__
:
Dict
[
str
,
Any
]
def
__call__
(
self
,
*
args
:
pd
.
Series
)
->
PandasLike
:
...
...
# pragma: no cover
class
OptionalNone
:
...
...
This diff is collapsed.
Click to expand it.
tests/core/test_FunctionsMixin.py
0 → 100644
+
28
−
0
View file @
5ccd9b25
#!/usr/bin/env python
import
inspect
import
pytest
from
saqc.core.modules
import
FunctionsMixin
methods
=
[
attr
for
attr
in
dir
(
FunctionsMixin
)
if
callable
(
getattr
(
FunctionsMixin
,
attr
))
and
not
attr
.
startswith
(
"
_
"
)
]
@pytest.mark.parametrize
(
"
name
"
,
methods
)
def
test_redirect_call
(
name
):
fmixin
=
FunctionsMixin
()
method
=
getattr
(
fmixin
,
name
)
params
=
inspect
.
signature
(
method
).
parameters
assert
"
field
"
in
params
assert
"
kwargs
"
in
params
dummy_params
=
dict
.
fromkeys
(
params
.
keys
())
dummy_params
.
pop
(
"
kwargs
"
)
err_msg
=
"'
FunctionsMixin
'
object has no attribute
'
_wrap
'"
with
pytest
.
raises
(
AttributeError
,
match
=
err_msg
):
method
(
**
dummy_params
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment