def testPostNoPackageInfoFileUploaded(self):
    self.mox.StubOutWithMock(uploadpkg.handlers, 'IsBlobstore')
    uploadpkg.handlers.IsBlobstore().AndReturn(True)
    self.MockDoMunkiAuth(require_level=uploadpkg.gaeserver.LEVEL_UPLOADPKG)
    self.MockSelf('get_uploads')
    upload_files = ['some file']
    pkginfo_files = []
    filename = 'fooname.dmg'
    pkginfo = 'anything'
    install_types = ['managed_installs', 'managed_updates']
    catalogs = ['unstable']
    self.request.get('user').AndReturn('foouser')
    self.request.get('name').AndReturn(filename)
    self.request.get('install_types').AndReturn(','.join(install_types))
    self.request.get('catalogs', None).AndReturn(','.join(catalogs))
    self.request.get('manifests', None).AndReturn(None)
    self.c.get_uploads('file').AndReturn(upload_files)
    self.c.get_uploads('pkginfo').AndReturn(pkginfo_files)
    self.request.get('pkginfo').AndReturn(None)

    self.MockRedirect('/uploadpkg?mode=error&msg=No%20file%20received')

    self.mox.ReplayAll()
    self.c.post()
    self.mox.VerifyAll()
Test post with no file supplied.
dataset/ETHPy150Open google/simian/src/tests/simian/mac/munki/handlers/uploadpkg_test.py/UploadPackageTest.testPostNoPackageInfoFileUploaded