Exemplo n.º 1
0
    def test_main(self, boot_shell):
        main(['stoq'])
        boot_shell().main.assert_called_once_with(None, None)
        boot_shell.reset_mock()

        main(['stoq', 'payable'])
        boot_shell().main.assert_called_once_with('payable', None)
        boot_shell.reset_mock()

        main(['stoq', 'payable/'])
        boot_shell().main.assert_called_once_with('payable', None)
        boot_shell.reset_mock()

        main(['stoq', 'payable', 'AddPayment'])
        boot_shell().main.assert_called_once_with('payable', 'AddPayment')
        boot_shell.reset_mock()

        with self.assertRaisesRegexp(SystemExit,
                                     stoq.version):
            main(['stoq', '--version'])

        with self.assertRaisesRegexp(
            SystemExit,
            r"'no-such-app' is not an application. "
            r"Valid applications are: \[[a-z,\' ]+\]"):
            main(['stoq', 'no-such-app'])
Exemplo n.º 2
0
    def test_main(self, boot_shell):
        main(['stoq'])
        boot_shell().main.assert_called_once_with(None, None)
        boot_shell.reset_mock()

        main(['stoq', 'payable'])
        boot_shell().main.assert_called_once_with('payable', None)
        boot_shell.reset_mock()

        main(['stoq', 'payable/'])
        boot_shell().main.assert_called_once_with('payable', None)
        boot_shell.reset_mock()

        main(['stoq', 'payable', 'AddPayment'])
        boot_shell().main.assert_called_once_with('payable', 'AddPayment')
        boot_shell.reset_mock()

        with self.assertRaises(SystemExit):
            main(['stoq', '--version'])

        with self.assertRaisesRegex(
                SystemExit, r"'no-such-app' is not an application. "
                r"Valid applications are: \[[a-z,\' ]+\]"):
            main(['stoq', 'no-such-app'])
Exemplo n.º 3
0
import reportlab.pdfbase._fontdata_widths_timesroman
import reportlab.pdfbase._fontdata_widths_zapfdingbats

from stoq.main import main

# Pyflakes
reportlab.pdfbase._fontdata
reportlab.pdfbase._fontdata_enc_macexpert
reportlab.pdfbase._fontdata_enc_macroman
reportlab.pdfbase._fontdata_enc_pdfdoc
reportlab.pdfbase._fontdata_enc_standard
reportlab.pdfbase._fontdata_enc_symbol
reportlab.pdfbase._fontdata_enc_winansi
reportlab.pdfbase._fontdata_enc_zapfdingbats
reportlab.pdfbase._fontdata_widths_courierboldoblique
reportlab.pdfbase._fontdata_widths_courierbold
reportlab.pdfbase._fontdata_widths_courieroblique
reportlab.pdfbase._fontdata_widths_courier
reportlab.pdfbase._fontdata_widths_helveticaboldoblique
reportlab.pdfbase._fontdata_widths_helveticabold
reportlab.pdfbase._fontdata_widths_helveticaoblique
reportlab.pdfbase._fontdata_widths_helvetica
reportlab.pdfbase._fontdata_widths_symbol
reportlab.pdfbase._fontdata_widths_timesbolditalic
reportlab.pdfbase._fontdata_widths_timesbold
reportlab.pdfbase._fontdata_widths_timesroman
reportlab.pdfbase._fontdata_widths_zapfdingbats

pkg_resources.require('stoqdrivers')
sys.exit(main(sys.argv))