def testProfileFetching(self):

    profile_name = "nt/GUID/F8E2A8B5C9B74BF4A6E4A48F180099942"

    FakeHandle.read_count = 0

    with utils.Stubber(urllib2, "urlopen", FakeOpen):
      profile = self.server.GetProfileByName(
          profile_name,
          version=constants.PROFILE_REPOSITORY_VERSION)
      uncompressed = zlib.decompress(profile.data, 16 + zlib.MAX_WBITS)
      self.assertTrue("BusQueryDeviceID" in uncompressed)

    # We issued one http request.
    self.assertEqual(FakeHandle.read_count, 1)

    with utils.Stubber(urllib2, "urlopen", FakeOpen):
      profile = self.server.GetProfileByName(
          profile_name, version=constants.PROFILE_REPOSITORY_VERSION)

    # This time it should have been cached.
    self.assertEqual(FakeHandle.read_count, 1)
dataset/ETHPy150Open google/grr/grr/lib/rekall_profile_server_test.py/ProfileServerTest.testProfileFetching/original