def testGetSuccess(self):
    """Tests get()."""
    mod_type = 'owner'
    target = 'foouser'
    pkg_name = 'Foo%20Pkg-1.2'
    mock_query = self._MockModTypeModel(mod_type)

    mock_entity1 = self.mox.CreateMockAnything()
    mock_entity2 = self.mox.CreateMockAnything()

    self.MockDoUserAuth(is_admin=True)
    self.request.get_all('install_types').AndReturn([])

    self.c.model = mock_query
    self.c.model.all().AndReturn(mock_query)
    mock_query.filter(mod_type % '%s =', target).AndReturn(mock_query)
    mock_query.filter('value =', urllib.unquote(pkg_name)).AndReturn(mock_query)
    mock_iter = self.mox.CreateMockAnything()
    mock_query.__iter__().AndReturn(mock_iter)
    mock_iter.next().AndReturn(mock_entity1)
    mock_entity1.Serialize().AndReturn('1')
    mock_iter.next().AndReturn(mock_entity2)
    mock_entity2.Serialize().AndReturn('2')
    mock_iter.next().AndRaise(StopIteration)

    self.c.response.headers.__setitem__('Content-Type', 'application/json')
    self.c.response.out.write(['1', '2'])

    self.mox.ReplayAll()
    self.c.get(mod_type=mod_type, target=target, pkg_name=pkg_name)
    self.mox.VerifyAll()
dataset/ETHPy150Open google/simian/src/tests/simian/mac/api/dynamic_manifest_test.py/DynamicManifestHandlersTest.testGetSuccess/swapped operands of `%`