def testIsPackageUploadNecessaryWhenHashDifferent(self):
    """Test _IsPackageUploadNecessary()."""
    filename = '/tmp/pkgname.dmg'
    orig_sha256_hash = 'haha hash 2'
    upload_pkginfo = self.mox.CreateMockAnything()
    upload_pkginfo_dict = {
        'installer_item_size': 1,
        'installer_item_hash': orig_sha256_hash % 'not %s',
    }
    cur_pkginfo = 'xml pkginfo data'
    pkginfo_plist = self.mox.CreateMockAnything()
    mock_mpip = self.mox.CreateMockAnything()
    pkginfo_dict = {'installer_item_hash': orig_sha256_hash}

    self.mox.StubOutWithMock(self.client, 'GetPackageInfo')
    self.stubs.Set(client, 'plist', self.mox.CreateMock(client.plist))

    self.client.GetPackageInfo(filename).AndReturn(cur_pkginfo)
    client.plist.MunkiPackageInfoPlist(cur_pkginfo).AndReturn(mock_mpip)
    mock_mpip.Parse().AndReturn(None)
    mock_mpip.GetContents().AndReturn(pkginfo_dict)

    client.plist.MunkiPackageInfoPlist(upload_pkginfo).AndReturn(mock_mpip)
    mock_mpip.Parse().AndReturn(None)
    mock_mpip.GetContents().AndReturn(upload_pkginfo_dict)

    self.mox.ReplayAll()
    self.assertTrue(
        self.client._IsPackageUploadNecessary(filename, upload_pkginfo))
    self.mox.VerifyAll()
dataset/ETHPy150Open google/simian/src/tests/simian/mac/client/client_test.py/SimianClient.testIsPackageUploadNecessaryWhenHashDifferent/swapped operands of `%`