예제 #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'])
예제 #2
0
파일: test_main.py 프로젝트: 5l1v3r1/stoq-1
    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'])
예제 #3
0
파일: __main__.py 프로젝트: tmaxter/stoq
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))