Beispiel #1
0
    def test_irpef(self):

        try:
            original_raw_input = __builtins__.raw_input

            __builtins__.raw_input = lambda _: '65000'
            with captured_output() as (out, err):
                main()
                output = out.getvalue().strip()
            self.assertAlmostEqual(float(output), 21320, delta=0.01)

        finally:
            __builtins__.raw_input = original_raw_input
Beispiel #2
0
    def test_input_sequence(self):

        inputs = [27450, 'still_test', 'test']

        try:
            fake_input = inputs.pop
            original_raw_input = __builtins__.raw_input
            __builtins__.raw_input = lambda _: fake_input()

            with captured_output() as (out, err):
                main()
                output = out.getvalue().strip()

            self.assertAlmostEqual(float(output), 6811.50, delta=0.01)

        finally:
            __builtins__.raw_input = original_raw_input
 def test_aliquota_41l(self):
     argv = ['test-istance', 55000.50]
     self.assertEqual(c.main(argv), 17220.41)
 def test_aliquota_43l(self):
     argv = ['test-istance', 75000.50]
     self.assertEqual(c.main(argv), 25420.43)
 def test_aliquota_38u(self):
     argv = ['test-istance', 55000.49]
     self.assertEqual(c.main(argv), 17220)
 def test_aliquota_38l(self):
     argv = ['test-istance', 28000.50]
     self.assertEqual(c.main(argv), 6960.38)
 def test_aliquota_27u(self):
     argv = ['test-istance', 28000.49]
     self.assertEqual(c.main(argv), 6960)
 def test_aliquota_27l(self):
     argv = ['test-istance', 15000.50]
     self.assertEqual(c.main(argv), 3450.27)
 def test_aliquota_23u(self):
     argv = ['test-istance', 15000.49]
     self.assertEqual(c.main(argv), 3450)