GnuCash  5.6-150-g038405b370+
Public Member Functions
test_price_and_wrapping.TestGetPriceReturnsGncNumeric Class Reference
Inheritance diagram for test_price_and_wrapping.TestGetPriceReturnsGncNumeric:
test_price_and_wrapping.PriceSession

Public Member Functions

def test_get_latest_price_returns_gnc_numeric (self)
 
def test_get_nearest_price_returns_gnc_numeric (self)
 
def test_get_nearest_before_price_returns_gnc_numeric (self)
 
def test_get_latest_price_arithmetic (self)
 
- Public Member Functions inherited from test_price_and_wrapping.PriceSession
def setUp (self)
 
def tearDown (self)
 

Additional Inherited Members

- Data Fields inherited from test_price_and_wrapping.PriceSession
 ses
 
 book
 
 table
 
 usd
 
 test_comm
 
 pricedb
 
 price1
 
 price2
 

Detailed Description

Verify that get_latest_price, get_nearest_price, and
get_nearest_before_price return GncNumeric instead of raw
_gnc_numeric.

Definition at line 388 of file test_price_and_wrapping.py.

Member Function Documentation

◆ test_get_latest_price_arithmetic()

def test_price_and_wrapping.TestGetPriceReturnsGncNumeric.test_get_latest_price_arithmetic (   self)
Verify the returned GncNumeric supports arithmetic.

Definition at line 410 of file test_price_and_wrapping.py.

410  def test_get_latest_price_arithmetic(self):
411  """Verify the returned GncNumeric supports arithmetic."""
412  val = self.pricedb.get_latest_price(self.test_comm, self.usd)
413  doubled = val + val
414  self.assertIsInstance(doubled, GncNumeric)
415  self.assertAlmostEqual(float(doubled), float(val) * 2, places=6)
416 
417 
418 # ---------------------------------------------------------------------------
419 # Test: ClassFromFunctions double-wrap protection
420 # ---------------------------------------------------------------------------

The documentation for this class was generated from the following file: