示例#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
示例#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
示例#3
0
 def test_aliquota_41l(self):
     argv = ['test-istance', 55000.50]
     self.assertEqual(c.main(argv), 17220.41)
示例#4
0
 def test_aliquota_43l(self):
     argv = ['test-istance', 75000.50]
     self.assertEqual(c.main(argv), 25420.43)
示例#5
0
 def test_aliquota_38u(self):
     argv = ['test-istance', 55000.49]
     self.assertEqual(c.main(argv), 17220)
示例#6
0
 def test_aliquota_38l(self):
     argv = ['test-istance', 28000.50]
     self.assertEqual(c.main(argv), 6960.38)
示例#7
0
 def test_aliquota_27u(self):
     argv = ['test-istance', 28000.49]
     self.assertEqual(c.main(argv), 6960)
示例#8
0
 def test_aliquota_27l(self):
     argv = ['test-istance', 15000.50]
     self.assertEqual(c.main(argv), 3450.27)
示例#9
0
 def test_aliquota_23u(self):
     argv = ['test-istance', 15000.49]
     self.assertEqual(c.main(argv), 3450)