Verify that GncPrice / GncPriceDB methods return properly wrapped
Python objects instead of raw SwigPyObjects.
Definition at line 69 of file test_price_and_wrapping.py.
◆ test_clone_returns_gnc_price()
| test_price_and_wrapping.TestGncPriceWrapping.test_clone_returns_gnc_price |
( |
|
self | ) |
|
Definition at line 105 of file test_price_and_wrapping.py.
105 def test_clone_returns_gnc_price(self):
106 price = self.pricedb.lookup_latest(self.test_comm, self.usd)
107 self.assertIsNotNone(price)
108 cloned = price.clone(self.book)
109 self.assertIsInstance(cloned, GncPrice)
110
◆ test_get_commodity_returns_gnc_commodity()
| test_price_and_wrapping.TestGncPriceWrapping.test_get_commodity_returns_gnc_commodity |
( |
|
self | ) |
|
Definition at line 87 of file test_price_and_wrapping.py.
87 def test_get_commodity_returns_gnc_commodity(self):
88 price = self.pricedb.lookup_latest(self.test_comm, self.usd)
89 self.assertIsNotNone(price)
90 comm = price.get_commodity()
91 self.assertIsInstance(comm, GncCommodity)
92
◆ test_get_currency_returns_gnc_commodity()
| test_price_and_wrapping.TestGncPriceWrapping.test_get_currency_returns_gnc_commodity |
( |
|
self | ) |
|
Definition at line 93 of file test_price_and_wrapping.py.
93 def test_get_currency_returns_gnc_commodity(self):
94 price = self.pricedb.lookup_latest(self.test_comm, self.usd)
95 self.assertIsNotNone(price)
96 curr = price.get_currency()
97 self.assertIsInstance(curr, GncCommodity)
98
◆ test_get_prices_returns_list_of_gnc_price()
| test_price_and_wrapping.TestGncPriceWrapping.test_get_prices_returns_list_of_gnc_price |
( |
|
self | ) |
|
Definition at line 121 of file test_price_and_wrapping.py.
121 def test_get_prices_returns_list_of_gnc_price(self):
122 prices = self.pricedb.get_prices(self.test_comm, self.usd)
123 self.assertIsInstance(prices, list)
124 self.assertGreater(len(prices), 0)
125 for p in prices:
126 self.assertIsInstance(p, GncPrice)
127
◆ test_get_value_returns_gnc_numeric()
| test_price_and_wrapping.TestGncPriceWrapping.test_get_value_returns_gnc_numeric |
( |
|
self | ) |
|
Definition at line 99 of file test_price_and_wrapping.py.
99 def test_get_value_returns_gnc_numeric(self):
100 price = self.pricedb.lookup_latest(self.test_comm, self.usd)
101 self.assertIsNotNone(price)
102 val = price.get_value()
103 self.assertIsInstance(val, GncNumeric)
104
◆ test_lookup_latest_any_currency_returns_list_of_gnc_price()
| test_price_and_wrapping.TestGncPriceWrapping.test_lookup_latest_any_currency_returns_list_of_gnc_price |
( |
|
self | ) |
|
Definition at line 113 of file test_price_and_wrapping.py.
113 def test_lookup_latest_any_currency_returns_list_of_gnc_price(self):
114 prices = self.pricedb.lookup_latest_any_currency(self.test_comm)
115 self.assertIsInstance(prices, list)
116 self.assertGreater(len(prices), 0,
117 "Expected at least one price for TSTK")
118 for p in prices:
119 self.assertIsInstance(p, GncPrice)
120
◆ test_lookup_latest_returns_gnc_price()
| test_price_and_wrapping.TestGncPriceWrapping.test_lookup_latest_returns_gnc_price |
( |
|
self | ) |
|
Definition at line 75 of file test_price_and_wrapping.py.
75 def test_lookup_latest_returns_gnc_price(self):
76 price = self.pricedb.lookup_latest(self.test_comm, self.usd)
77 self.assertIsNotNone(price, "No price found for TSTK/USD")
78 self.assertIsInstance(price, GncPrice)
79
◆ test_lookup_nearest_before_any_currency()
| test_price_and_wrapping.TestGncPriceWrapping.test_lookup_nearest_before_any_currency |
( |
|
self | ) |
|
Definition at line 136 of file test_price_and_wrapping.py.
136 def test_lookup_nearest_before_any_currency(self):
137 date = datetime(2025, 7, 1)
138 prices = self.pricedb.lookup_nearest_before_any_currency_t64(
139 self.test_comm, date)
140 self.assertIsInstance(prices, list)
141 for p in prices:
142 self.assertIsInstance(p, GncPrice)
143
144
145
146
147
◆ test_lookup_nearest_in_time_any_currency()
| test_price_and_wrapping.TestGncPriceWrapping.test_lookup_nearest_in_time_any_currency |
( |
|
self | ) |
|
Definition at line 128 of file test_price_and_wrapping.py.
128 def test_lookup_nearest_in_time_any_currency(self):
129 date = datetime(2025, 1, 20)
130 prices = self.pricedb.lookup_nearest_in_time_any_currency_t64(
131 self.test_comm, date)
132 self.assertIsInstance(prices, list)
133 for p in prices:
134 self.assertIsInstance(p, GncPrice)
135
◆ test_nth_price_returns_gnc_price()
| test_price_and_wrapping.TestGncPriceWrapping.test_nth_price_returns_gnc_price |
( |
|
self | ) |
|
Definition at line 80 of file test_price_and_wrapping.py.
80 def test_nth_price_returns_gnc_price(self):
81 price = self.pricedb.nth_price(self.test_comm, 0)
82 self.assertIsNotNone(price, "nth_price(TSTK, 0) returned None")
83 self.assertIsInstance(price, GncPrice)
84
◆ test_comm
| test_price_and_wrapping.TestGncPriceWrapping.test_comm |
The documentation for this class was generated from the following file: