コード例 #1
0
ファイル: test_deploy.py プロジェクト: depop/parcel
    def test_build_deb(self):
        basepath = os.path.join(os.path.expanduser('~/'))
        d = Deployment('testapp', base=basepath)
        d.root_path = os.path.join(basepath, '.parcel')
        d.prepare_app()
        
        # test build, will not actually call fpm
        d.build_package()
        dest_file = os.path.join(os.path.dirname(__file__),"data", "testapp_0.1.2_all.deb")
        self.assertTrue(os.path.exists(dest_file))
        os.unlink(dest_file)

        # now do it without templates to exercise those paths
        d = Deployment('testapp', base=basepath)
        d.root_path = os.path.join(basepath, '.parcel_test')
        d.build_package(templates=False)
        dest_file = os.path.join(os.path.dirname(__file__),"data", "testapp_0.1.2_all.deb")
        self.assertTrue(os.path.exists(dest_file))
        os.unlink(dest_file)

        # now set some prerm etc directly and check
        d = Deployment('testapp', base=basepath)
        d.root_path = os.path.join(basepath, '.parcel_test')
        lines = ['test line one', 'test line two']
        d.prerm = " ".join(lines)
        d.postrm = " ".join(lines)
        d.preinst = " ".join(lines)
        d.postinst = " ".join(lines)
        d.build_package()
        dest_file = os.path.join(os.path.dirname(__file__),"data", "testapp_0.1.2_all.deb")
        self.assertTrue(os.path.exists(dest_file))
        os.unlink(dest_file)
コード例 #2
0
ファイル: test_deploy.py プロジェクト: zetsub0u/parcel
    def test_build_deb(self):
        basepath = os.path.join(os.path.expanduser('~/'))
        d = Deployment('testapp', base=basepath)
        d.root_path = os.path.join(basepath, '.parcel')
        d.prepare_app()

        # test build, will not actually call fpm
        d.build_package()
        dest_file = os.path.join(os.path.dirname(__file__), "data",
                                 "testapp_0.1.2_all.deb")
        self.assertTrue(os.path.exists(dest_file))
        os.unlink(dest_file)

        # now do it without templates to exercise those paths
        d = Deployment('testapp', base=basepath)
        d.root_path = os.path.join(basepath, '.parcel_test')
        d.build_package(templates=False)
        dest_file = os.path.join(os.path.dirname(__file__), "data",
                                 "testapp_0.1.2_all.deb")
        self.assertTrue(os.path.exists(dest_file))
        os.unlink(dest_file)

        # now set some prerm etc directly and check
        d = Deployment('testapp', base=basepath)
        d.root_path = os.path.join(basepath, '.parcel_test')
        lines = ['test line one', 'test line two']
        d.prerm = " ".join(lines)
        d.postrm = " ".join(lines)
        d.preinst = " ".join(lines)
        d.postinst = " ".join(lines)
        d.build_package()
        dest_file = os.path.join(os.path.dirname(__file__), "data",
                                 "testapp_0.1.2_all.deb")
        self.assertTrue(os.path.exists(dest_file))
        os.unlink(dest_file)
コード例 #3
0
ファイル: test_deploy.py プロジェクト: depop/parcel
 def test_build_rpm(self):
     basepath = os.path.join(os.path.expanduser('~/'))
     d = Deployment('testapp', base=basepath, arch=centos)
     d.root_path = os.path.join(basepath, '.parcel')
     d.prepare_app()
     
     # test build, will not actually call fpm
     d.build_package()
     dest_file = os.path.join(os.path.dirname(__file__),"data", "testapp_0.1.1-1.noarch.rpm")
     print dest_file
     self.assertTrue(os.path.exists(dest_file))
     os.unlink(dest_file)
コード例 #4
0
ファイル: test_deploy.py プロジェクト: zetsub0u/parcel
    def test_build_rpm(self):
        basepath = os.path.join(os.path.expanduser('~/'))
        d = Deployment('testapp', base=basepath, arch=centos)
        d.root_path = os.path.join(basepath, '.parcel')
        d.prepare_app()

        # test build, will not actually call fpm
        d.build_package()
        dest_file = os.path.join(os.path.dirname(__file__), "data",
                                 "testapp_0.1.1-1.noarch.rpm")
        print dest_file
        self.assertTrue(os.path.exists(dest_file))
        os.unlink(dest_file)