Files
invest-copilot/src/backend/tests/__pycache__/test_sec_filings.cpython-314-pytest-9.0.3.pyc
T

94 lines
14 KiB
Plaintext
Raw Normal View History

2026-05-30 11:28:59 -04:00
+
░└jcС@─Rt^RIt^RIHuHt^RIt!RR4tR#)З Tests for SEC filings endpoints.NcСHa─]tRt^toRtRtRtRtRtRt Rt
Rt Vt R #)
зTestSecFilingsrc┐ С╢"─RRRRRRRRR R
R R R
R/.VR,nVPR4GRjx─L
pVPp^хqTV8Hqf'gг\P!R%V3R&WE34RR\
P !49g\P!V4'd\P!V4MRR\P!V4R\P!V4/,pRRV/,p\\P!V44hR;p;reVP4p \V \4qf'Eg9RRR\
P !49g!\P!\4'd\P!\4MRRR\
P !49g\P!V 4'd\P!V 4MRRR\
P !49g!\P!\4'd\P!\4MRR\P!V4/,p
\\P!V
44hRp\V 4p ^qкV 8╛qU'Eg\P!R'V3R(W╪34RR\
P !49g!\P!\4'd\P!\4MRRR\
P !49g\P!V 4'd\P!V 4MRR\P!V 4R \P!V 4/,p
R!R"V
/,p\\P!V44hR;p ;r\V ^,R#,pRqoV8Hq╩'gy\P!R%V 3R)WЖ34R\P!V4R\P!V4/,p
R$R V
/,p
\\P!V
44hR;p;r╤R#EL!5i)*z!Returns SEC filings for a ticker.зidЗfiling-1зtickerзAAPLз form_typeЗ10-Kз filing_dateЗ
2024-01-01з
period_endЗ
2023-12-31зurlzShttps://www.sec.gov/Archives/edgar/data/320193/000032019324000006/aapl-20231231.htmз descriptionЗ
Annual reportз
execute_queryЗ/api/v1/sec/AAPL/filingsNзpy0зresponseзpy2зpy5Зassert %(py7)sзpy7z5assert %(py4)s
{%(py4)s = %(py0)s(%(py1)s, %(py2)s)
}з
isinstanceзpy1зdataзlistзpy4зlenзpy3зpy6Зassert %(py8)sзpy8зformTypezassert %(py6)s╘З==╘z3%(py2)s
{%(py2)s = %(py0)s.status_code
} == %(py5)s╘З>=╘z0%(py3)s
{%(py3)s = %(py0)s(%(py1)s)
} >= %(py6)s)z%(py1)s == %(py4)s)з return_valueзgetз status_codeз
@pytest_arз_call_reprcompareз @py_builtinsзlocalsз_should_repr_global_nameз _safereprзAssertionErrorз_format_explanationзjsonrrr)зselfзclientзmock_dbrз @py_assert1з @py_assert4з @py_assert3з @py_format6з @py_format8rз @py_format5з @py_assert2з @py_assert5з @py_format7з @py_format9з @py_assert0s&&& зR/home/laptran/ai-env/projects/invest-copilot/src/backend/tests/test_sec_filings.pyзtest_get_filingsзTestSecFilings.test_get_filings saИ─П░jь≤&ь≤Vь≤|ь≤lьпlь≤П
П
1
┬░у т-П ÷≥п$>с?в?┬ьв#я#п*═sп*═sя*в*в*в*с*п#в*в*в*в*в*в*┬xв*в*в*р*┬xв*в*ж*п#в*в*т*═sв*в*в*в*в*в*в*р*ь▐}┴}▀┬э≤$╓с%п%в%в%в%в%в%в%с%▄zв%в%в%р%▄zв%в%в%в%в%в%п%≤$в%в%в%р%≤$в%в%в%в%в%в%п%╓в%в%в%р%╓в%в%ж%п%в%в%в%в%в%т%э░4▀yп≤Aп≤A┴~вввт┬yвввввв▄sвввр▄sввввввп░4вввр░4ввж┬yввт≤Aввввввврь░A█w░zу"п,═fп,═fя,в,в,в,с,п"в,в,у,п"в,в,т,═fв,в,в,в,в,в,в,т,Р @Ыs:┌2Q╢Q╣A-Qб#CQфAQгAQх%CQк-AQл?DQc ┐ С."─.VR,nVPR4GRjx─L
pVPp^хqTV8Hqf'gг\P!R
V3RWE34RR\
P !49g\P!V4'd\P!V4MRR\P!V4R\P!V4/,pRR V/,p\\P!V44hR;p;reVPqD!4p.q√V 8Hq╙'gщ\P!R
V
3RWi34RR\
P !49g\P!V4'd\P!V4MRR\P!V4R
\P!V4R \P!V 4/,pR R V/,p \\P!V 44hR;p;p;r╘R#ELМ5i)z#Returns empty list when no filings.rz/api/v1/sec/NOEXIST/filingsNrrrrrrrzassert %(py9)sзpy9r%r')zC%(py4)s
{%(py4)s = %(py2)s
{%(py2)s = %(py0)s.json
}()
} == %(py7)s) r+r,r-r.r/r0r1r2r3r4r5r6) r7r8r9rr:r;r<r=r>з @py_assert6rAз @py_format10s &&& rEзtest_get_filings_emptyз%TestSecFilings.test_get_filings_emptys$И─Ю02┬░у т-ь÷≥п$AсBвB┬ьв#я#п*═sп*═sя*в*в*в*с*п#в*в*в*в*в*в*┬xв*в*в*р*┬xв*в*ж*п#в*в*т*═sв*в*в*в*в*в*в*р*ь▐}┴}п$┬}▀п$═"п$═"я$в$в$в$с$┬в$в$в$в$в$в$┬xв$в$в$р$┬xв$в$ж$┬}в$в$т$┬в$в$т$═"в$в$в$в$в$в$в$ж$РCЫs┌#H╔H╕A-HбC)Hе>BHc┐ С"─RRRRRRRRR R
R R R
R/.VR,nVPRRR/R7GRjx─L
pVPp^хqTV8Hqf'gг\P!RV3RWE34RR\
P !49g\P!V4'd\P!V4MRR\P!V4R\P!V4/,pRRV/,p\\P!V44hR;p;reVP4p RV 4p\V4qf'g╚RRR\
P !49g!\P!\4'd\P!\4MRR\P!V4R\P!V4/,p
\\P!V
44hR;rFR#ELц5i)zFilters filings by type.rrrrr r
r r r
rrzhttps://www.sec.gov/...rrrr╘зparamsNrrrrrrc3С8"─TFqR,R8Hx─K R#5i)r$r
N╘)з.0зfs& rEз <genexpr>зCTestSecFilings.test_get_filings_with_type_filter.<locals>.<genexpr>4sИ─п9╠D╗q░Z∙=═Fж*ЁDЫs┌z,assert %(py4)s
{%(py4)s = %(py0)s(%(py2)s)
}зallrr%r')
r+r,r-r.r/r0r1r2r3r4r5r6rW) r7r8r9rr:r;r<r=r>rr?s &&& rEз!test_get_filings_with_type_filterз0TestSecFilings.test_get_filings_with_type_filter$sIИ─П░jь≤&ь≤Vь≤|ь≤lьп0ь≤П
П
1
┬░у т-П ÷≥п$>х пU[пG\≤с]в]┬ьв#я#п*═sп*═sя*в*в*в*с*п#в*в*в*в*в*в*┬xв*в*в*р*┬xв*в*ж*п#в*в*т*═sв*в*в*в*в*в*в*р*ь▐}┴}▀┬ы9╠Dс9п9▄sп9с9п9ж9в9в9в9в9в9с9▄sв9в9в9р9▄sв9в9ж9п9в9в9т9п9в9в9в9в9в9в9Р^Ыs┌6G>╦G;╧A-G>б'C G>фA4G>c┐ Сf"─RRRRRRRRR R
R R R
R/RRRRRRRRR RR R R
R/.VR,nVPRR^/R7GRjx─L
pVPp^хqTV8Hqf'gг\P!R%V3R&WE34RR\
P !49g\P!V4'd\P!V4MRR\P!V4R\P!V4/,pRRV/,p\\P!V44hR;p;reVPq≥!4p\V4p
^q╨V 8Hqл'EgI\P!R%V 3R'W╚34RR\
P !49g!\P!\4'd\P!\4MRR R\
P !49g\P!V4'd\P!V4MRR!\P!V 4R\P!V4R\P!V
4R"\P!V 4/,p
R#R$V
/,p\\P!V44hR;p ;p;p
;rкR#ELg5i)(zRespects limit parameter.rЗf-1rrr r
r r r
rrЗ https://...rзAnnualzf-2z10-Qz
2024-04-01З
2024-03-31з QuarterlyrrзlimitrONrrrrrrrrr зpy10zassert %(py12)sзpy12r%r')zb%(py7)s
{%(py7)s = %(py0)s(%(py5)s
{%(py5)s = %(py3)s
{%(py3)s = %(py1)s.json
}()
})
} == %(py10)s╘
r+r,r-r.r/r0r1r2r3r4r5r6r)r7r8r9rr:r;r<r=r>r@rJз @py_assert9з @py_assert8з @py_format11з @py_format13s&&& rEзtest_get_filings_with_limitз*TestSecFilings.test_get_filings_with_limit6s╪И─П░5≤(═F╗K╦юпP\ь
≤<╗╟
╦}хhП
XЮ
░5≤(═F╗K╦юпP\ь
≤<╗╟
╦}хkП
[П1