def testInvalidSeek(self):
    """Tests that seeking fails for unsupported seek arguments."""
    daisy_chain_wrapper = DaisyChainWrapper(
        self._dummy_url, self.test_data_file_len, self.MockDownloadCloudApi([]))
    try:
      # SEEK_CUR is invalid.
      daisy_chain_wrapper.seek(0, whence=os.SEEK_CUR)
      self.fail('Expected exception')
    except IOError, e:
      self.assertIn('does not support seek mode', str(e))

    try:
      # Seeking from the end with an offset is invalid.
      daisy_chain_wrapper.seek(1, whence=os.SEEK_END)
      self.fail('Expected exception')
    except __HOLE__, e:
      self.assertIn('Invalid seek during daisy chain', str(e))
dataset/ETHPy150Open GoogleCloudPlatform/gsutil/gslib/tests/test_daisy_chain_wrapper.py/TestDaisyChainWrapper.testInvalidSeek