Feat: add ARgs and kwrds when intersepted
This commit is contained in:
@@ -4,7 +4,7 @@ import pandas as pd
|
||||
import pytest
|
||||
from pydantic import BaseModel
|
||||
|
||||
from scripts.intersept_not_valid import Interseptor
|
||||
from scripts.intersept_not_valid import ValidationInterseptor
|
||||
|
||||
|
||||
class FakeModel(BaseModel):
|
||||
@@ -13,7 +13,7 @@ class FakeModel(BaseModel):
|
||||
|
||||
|
||||
def test_init_composed():
|
||||
interceptor = Interseptor(FakeModel)
|
||||
interceptor = ValidationInterseptor(FakeModel)
|
||||
|
||||
def df_generator(nrows=3):
|
||||
records = [{"name": "plop", "age": random.randint(1, 50)} for _ in range(nrows)]
|
||||
@@ -27,7 +27,7 @@ def test_init_composed():
|
||||
|
||||
|
||||
def test_init_decorator():
|
||||
interceptor = Interseptor(FakeModel)
|
||||
interceptor = ValidationInterseptor(FakeModel)
|
||||
|
||||
@interceptor
|
||||
def df_generator(nrows=3):
|
||||
@@ -40,7 +40,7 @@ def test_init_decorator():
|
||||
|
||||
|
||||
def test_intersept_not_valid():
|
||||
interceptor = Interseptor(FakeModel)
|
||||
interceptor = ValidationInterseptor(FakeModel)
|
||||
|
||||
@interceptor
|
||||
def df_generator():
|
||||
@@ -57,7 +57,9 @@ def test_intersept_not_valid():
|
||||
{
|
||||
"name": "hop",
|
||||
"age": "ui",
|
||||
"InterseptorOrigin": "df_generator",
|
||||
"InterseptorIndex": 1,
|
||||
"ValidationInterseptorFunc": "df_generator",
|
||||
"ValidationInterseptorArgs": (),
|
||||
"ValidationInterseptorKwrds": {},
|
||||
"ValidationInterseptorIndex": 1,
|
||||
}
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user