Exemple #1
0
 def setUp(self):
     '''Before testing'''
     print('---')
     print('T03_PontonInstall')
     print('---')
     self.__inst = PontonInstall()
     self.__help = Helper()
Exemple #2
0
class T03_PontonInstall(unittest.TestCase):
    '''T03_PontonInstall
       Test PontonInstall

    Test:
    cancel()
    get_to_do()
    app_inst('ostype')
    py_inst('ostype', 'pkgtype')
    what_to_do('pyver', 'wxver')
    wx_inst('ostype', 'pkgtype')

    '''

    def setUp(self):
        '''Before testing'''
        print('---')
        print('T03_PontonInstall')
        print('---')
        self.__inst = PontonInstall()
        self.__help = Helper()

    def test(self):
        '''Test PontonInstall'''
        # cancel
        self.failUnlessEqual(self.__inst.cancel(), None)
        # app_inst
        for i in ('linux', 'win', 'mac'):
            self.failUnlessEqual(self.__inst.app_inst(i), None)
            self.failUnlessEqual(self.__help.get_pontondat(),
                                 'appinst')
        # py_inst
        for i, j, k, L in [('linux', 'apt-get', 'none', 'pyaptget'),
                           ('linux', 'yum', 'none', 'pyyum'),
                           ('win', 'none', '32', 'pyinst32'),
                           ('win', 'none', '64', 'pyinst64'),
                           ('mac', 'hdid', '32', 'pyhdid32'),
                           ('mac', 'hdid', '64', 'pyhdid64')]:
            self.failUnlessEqual(self.__inst.py_inst(i, j, k), None)
            self.failUnlessEqual(self.__help.get_pontondat(), L)
            # test system scripts
            self.__help.test_setup()
        # wx_inst
        for i, j, k, L in [('linux', 'apt-get', 'none', 'wxaptget'),
                           ('linux', 'yum', 'none', 'wxyum'),
                           ('win', 'none', '32', 'wxinst32'),
                           ('win', 'none', '64', 'wxinst64'),
                           ('mac', 'hdid', '32', 'wxhdid'),
                           ('mac', 'hdid', '64', 'wxhdid')]:
            self.failUnlessEqual(self.__inst.wx_inst(i, j, k), None)
            self.failUnlessEqual(self.__help.get_pontondat(), L)
            # test system scripts
            self.__help.test_setup()
        # what_to_do & get_to_do.
        for p, w, t, L in [('2.7', '2.8', 'app_inst', '..'),
                           ('3.2', '0.0', 'py_inst',
                            '[1] INSTALL RECOMMENDED VERSION'),
                           ('3.2', '0.0', '',
                            '[2] CANCEL'),
                           ('2.9', '0.0', 'wx_inst', '..'),
                           ('2.7', '2.6', 'wx_inst',
                            '[1] UPDATE TO RECOMMENDED VERSION'),
                           ('2.7', '2.6', 'app_inst',
                            '[2] KEEP EXISTING VERSION'),
                           ('2.7', '2.6', '', '[3] CANCEL'),
                           ('2.6', '2.2', 'py_inst',
                            '[1] UPDATE TO RECOMMENDED VERSION'),
                           ('2.6', '2.2', 'app_inst',
                            '[2] KEEP EXISTING VERSION'),
                           ('2.6', '2.2', '', '[3] CANCEL'),
                           ('2.5', '0.0', 'py_inst',
                            '[1] UPDATE TO RECOMMENDED VERSION'),
                           ('2.5', '0.0', '', '[2] CANCEL')]:
            print('\n\n\n\n\n' + L)
            self.failUnlessEqual(self.__inst.what_to_do(p, w), None)
            self.failUnlessEqual(self.__inst.get_to_do(), t)
        # set_srcdir_dstdir
        self.failUnlessEqual(self.__inst.set_srcdir_dstdir(), None)
        # write_src_dir
        self.failUnlessEqual(self.__inst.write_src_dir(), None)
        # gui_copy
        self.failUnlessEqual(self.__inst.gui_copy(), None)