def test_prep_hit_full_in_rounded_case(self):
     actual = _prep_hit(D('5.00'))
     expected = (
         1000,
         u'1000 cents ($9.41 [rounded up from $5.00] + $0.59 fee = $10.00)',
         D('10.00'), D('0.59'))
     assert actual == expected
    def prep(self, amount):
        """Given a dollar amount as a string, return a 3-tuple.

        The return tuple is like the one returned from _prep_hit, but with the
        second value, a log message, removed.

        """
        typecheck(amount, unicode)
        out = list(_prep_hit(D(amount)))
        out = [out[0]] + out[2:]
        return tuple(out)
    def prep(self, amount):
        """Given a dollar amount as a string, return a 3-tuple.

        The return tuple is like the one returned from _prep_hit, but with the
        second value, a log message, removed.

        """
        typecheck(amount, unicode)
        out = list(_prep_hit(D(amount)))
        out = [out[0]] + out[2:]
        return tuple(out)
 def test_prep_hit_full_in_rounded_case(self):
     actual = _prep_hit(D("5.00"))
     expected = (1000, "1000 cents ($9.41 [rounded up from $5.00] + $0.59 fee = $10.00)", D("10.00"), D("0.59"))
     assert actual == expected
 def test_prep_hit_basically_works(self):
     actual = _prep_hit(D("20.00"))
     expected = (2091, "2091 cents ($20.00 + $0.91 fee = $20.91)", D("20.91"), D("0.91"))
     assert actual == expected
 def test_prep_hit_basically_works(self):
     actual = _prep_hit(D('20.00'))
     expected = (2091,
                 u'2091 cents ($20.00 + $0.91 fee = $20.91)',
                 D('20.91'), D('0.91'))
     assert actual == expected
 def test_prep_hit_full_in_rounded_case(self):
     actual = _prep_hit(D('5.00'))
     expected = (1000,
                 u'1000 cents ($9.41 [rounded up from $5.00] + $0.59 fee = $10.00)',
                 D('10.00'), D('0.59'))
     assert actual == expected
 def test_prep_hit_basically_works(self):
     actual = _prep_hit(D('20.00'))
     expected = (2091,
                 u'2091 cents ($20.00 + $0.91 fee = $20.91)',
                 D('20.91'), D('0.91'))
     assert actual == expected