File diff 7f3a26b5557d → 5b6831292401
tests/test_reports_balance.py
Show inline comments
...
 
@@ -345,11 +345,23 @@ def test_iadd_balance(mapping):
 
    expected = core.Balance(amounts_from_map(expect_numbers))
 
    assert balance == expected
 

	
 
def test_copy():
 
    amounts = frozenset(amounts_from_map({'USD': 10, 'EUR': '.001'}))
 
    # Use a ridiculous tolerance to test it doesn't matter.
 
    actual = core.Balance(amounts, 100).copy()
 
    assert frozenset(actual.values()) == amounts
 
@pytest.mark.parametrize('tolerance', TOLERANCES)
 
def test_copy(tolerance):
 
    eur = testutil.Amount('.003', 'EUR')
 
    source = core.Balance([eur], tolerance)
 
    new = source.copy()
 
    assert source is not new
 
    assert dict(source) == dict(new)
 
    assert new.tolerance == tolerance
 

	
 
@pytest.mark.parametrize('tolerance', TOLERANCES)
 
def test_copy_tolerance_arg(tolerance):
 
    eur = testutil.Amount('.003', 'EUR')
 
    source = core.Balance([eur])
 
    new = source.copy(tolerance)
 
    assert source is not new
 
    assert dict(source) == dict(new)
 
    assert new.tolerance == tolerance
 

	
 
@pytest.mark.parametrize('tolerance', TOLERANCES)
 
def test_clean_copy(tolerance):
...
 
@@ -361,6 +373,7 @@ def test_clean_copy(tolerance):
 
    else:
 
        expected = {usd}
 
    assert frozenset(actual.values()) == expected
 
    assert actual.tolerance == tolerance
 

	
 
@pytest.mark.parametrize('tolerance', TOLERANCES)
 
def test_clean_copy_arg(tolerance):
...
 
@@ -372,6 +385,7 @@ def test_clean_copy_arg(tolerance):
 
    else:
 
        expected = {usd}
 
    assert frozenset(actual.values()) == expected
 
    assert actual.tolerance == tolerance
 

	
 
@pytest.mark.parametrize('mapping,expected', DEFAULT_STRINGS)
 
def test_str(mapping, expected):