MCPcopy
hub / github.com/JerBouma/FinanceDatabase / test_select

Function test_select

tests/test_equities.py:20–74  ·  view source on GitHub ↗

Verify select() output for representative equity filter combinations.

(recorder: Recorder)

Source from the content-addressed store, hash-verified

18
19
20def test_select(recorder: Recorder) -> None:
21 """Verify select() output for representative equity filter combinations."""
22 smoke = equities.select()
23 assert not smoke.empty
24 assert "country" in smoke.columns
25 recorder.capture(equities.select().iloc[:5])
26 recorder.capture(equities.select(country="Canada").iloc[:5])
27 recorder.capture(equities.select(sector="Communication Services").iloc[:5])
28 recorder.capture(equities.select(industry_group="Insurance").iloc[:5])
29 recorder.capture(equities.select(market_cap="Large Cap").iloc[:5])
30 recorder.capture(equities.select(exchange="AMS").iloc[:5])
31 recorder.capture(
32 equities.select(country="United States", sector="Financials").iloc[:5]
33 )
34 recorder.capture(
35 equities.select(
36 country="United States", industry_group="Media & Entertainment"
37 ).iloc[:5]
38 )
39 recorder.capture(equities.select(sector="Energy", industry_group="Energy").iloc[:5])
40 recorder.capture(
41 equities.select(
42 country="United States",
43 sector="Health Care",
44 industry_group="Pharmaceuticals, Biotechnology & Life Sciences",
45 ).iloc[:5]
46 )
47 recorder.capture(
48 equities.select(
49 country="United States",
50 sector="Utilities",
51 industry_group="Utilities",
52 industry="Electric Utilities",
53 market="NASDAQ Global Select",
54 ).iloc[:5]
55 )
56 recorder.capture(
57 equities.select(
58 country="United States",
59 sector="Materials",
60 industry_group="Materials",
61 market="Johannesburg Stock Exchange",
62 currency="USD",
63 ).iloc[:5]
64 )
65 recorder.capture(
66 equities.select(
67 country="Japan",
68 sector="Energy",
69 industry_group="Energy",
70 market="Tokyo Stock Exchange",
71 currency="JPY",
72 only_primary_listing=True,
73 ).iloc[:5]
74 )
75
76
77def test_show_options(recorder: Recorder) -> None:

Callers

nothing calls this directly

Calls 2

captureMethod · 0.80
selectMethod · 0.45

Tested by

no test coverage detected