def test_get_separators(self): expected = {"thousand_sep": ",", "decimal_sep": "."} nt.assert_equal(expected, ft.get_separators("2,123.45")) expected = {"thousand_sep": ".", "decimal_sep": ","} nt.assert_equal(expected, ft.get_separators("2.123,45")) with nt.assert_raises(ValueError): ft.get_separators("spam")
def test_get_separators(self): expected = {'thousand_sep': ',', 'decimal_sep': '.'} nt.assert_equal(expected, ft.get_separators('2,123.45')) expected = {'thousand_sep': '.', 'decimal_sep': ','} nt.assert_equal(expected, ft.get_separators('2.123,45')) with nt.assert_raises(ValueError): ft.get_separators('spam')
def test_get_separators(self): expected = {'thousand_sep': ',', 'decimal_sep': '.'} nt.assert_equal(expected, ft.get_separators('2,123.45')) expected = {'thousand_sep': '.', 'decimal_sep': ','} nt.assert_equal(expected, ft.get_separators('2.123,45')) with nt.assert_raises(TypeError): ft.get_separators('spam')
def convert_amount(content): """Convert number to a decimal amount""" return to_decimal(content, **get_separators(content))
def convert_amount(content): return to_decimal(content, **get_separators(content))