Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(42)  |  Call(42)  |  Derive(0)  |  Import(0)
Fail if the two objects are unequal as determined by the '=='
operator.

src/g/s/gsutil-3.42/gslib/tests/test_cp.py   gsutil(Download)
                                return_stdout=True).split('\n')
      # 2 lines of listing output, 1 summary line, 1 empty line from \n split.
      self.assertEquals(len(listing1), 4)
      self.assertEquals(len(listing2), 4)
 
      # First object in each bucket should match in size and version-less name.
      size1, _, uri_str1, _ = listing1[0].split()
      self.assertEquals(size1, str(len('data0')))
      self.assertEquals(storage_uri(uri_str1).object_name, 'k')
      self.assertEquals(storage_uri(uri_str1).object_name, 'k')
      size2, _, uri_str2, _ = listing2[0].split()
      self.assertEquals(size2, str(len('data0')))
      self.assertEquals(storage_uri(uri_str2).object_name, 'k')
 

src/g/s/gsutil-HEAD/gslib/tests/test_cp.py   gsutil(Download)
                                return_stdout=True).split('\n')
      # 2 lines of listing output, 1 summary line, 1 empty line from \n split.
      self.assertEquals(len(listing1), 4)
      self.assertEquals(len(listing2), 4)
 
      # First object in each bucket should match in size and version-less name.
      size1, _, uri_str1, _ = listing1[0].split()
      self.assertEquals(size1, str(len('data0')))
      self.assertEquals(storage_uri(uri_str1).object_name, 'k')
      self.assertEquals(storage_uri(uri_str1).object_name, 'k')
      size2, _, uri_str2, _ = listing2[0].split()
      self.assertEquals(size2, str(len('data0')))
      self.assertEquals(storage_uri(uri_str2).object_name, 'k')
 

src/g/s/gsutil-3.42/gslib/tests/test_compose.py   gsutil(Download)
        expected_status=1, return_stderr=True)
    self.assertEquals(
        'CommandException: "compose" requires at least 2 component objects.\n',
        stderr)
 
        'Composing gs://b/composite-obj from 2 component objects.\n'
        'BotoClientError: GCS does not support inter-bucket composing.\n')
    self.assertEquals(expected_msg, stderr)
 
  @unittest.skipUnless(HAS_S3_CREDS, 'Test requires S3 credentials.')
    expected_msg = ('CommandException: "compose" called on URI with '
                    'unsupported provider (%s).\n' % 's3://b/o3')
    self.assertEquals(expected_msg, stderr)
 
  @unittest.skipUnless(HAS_S3_CREDS, 'Test requires S3 credentials.')
    expected_msg = ('CommandException: "compose" called on URI with '
                    'unsupported provider (%s).\n' % 's3://b/o2')
    self.assertEquals(expected_msg, stderr)
 
  def test_versioned_target_disallowed(self):
                    'cannot be the destination for gsutil compose - abort.\n'
                    % 'gs://b/o3#1234')
    self.assertEquals(expected_msg, stderr)
 
 

src/g/s/gsutil-HEAD/gslib/tests/test_compose.py   gsutil(Download)
        expected_status=1, return_stderr=True)
    self.assertEquals(
        'CommandException: "compose" requires at least 2 component objects.\n',
        stderr)
 
        'Composing gs://b/composite-obj from 2 component objects.\n'
        'BotoClientError: GCS does not support inter-bucket composing.\n')
    self.assertEquals(expected_msg, stderr)
 
  @unittest.skipUnless(HAS_S3_CREDS, 'Test requires S3 credentials.')
    expected_msg = ('CommandException: "compose" called on URI with '
                    'unsupported provider (%s).\n' % 's3://b/o3')
    self.assertEquals(expected_msg, stderr)
 
  @unittest.skipUnless(HAS_S3_CREDS, 'Test requires S3 credentials.')
    expected_msg = ('CommandException: "compose" called on URI with '
                    'unsupported provider (%s).\n' % 's3://b/o2')
    self.assertEquals(expected_msg, stderr)
 
  def test_versioned_target_disallowed(self):
                    'cannot be the destination for gsutil compose - abort.\n'
                    % 'gs://b/o3#1234')
    self.assertEquals(expected_msg, stderr)
 
 

src/g/s/gsutil-3.42/gslib/tests/test_web.py   gsutil(Download)
    stdout = self.RunGsUtil(
        self._get_cmd_prefix + [suri(bucket_uri)], return_stdout=True)
    self.assertEquals(stdout, WEBCFG_FULL)
 
  def test_main(self):
    bucket_uri = self.CreateBucket()
    self.RunGsUtil(self._set_cmd_prefix + ['-m', 'main', suri(bucket_uri)])
    stdout = self.RunGsUtil(
        self._get_cmd_prefix + [suri(bucket_uri)], return_stdout=True)
    self.assertEquals(stdout, WEBCFG_MAIN)
    stdout = self.RunGsUtil(
        self._get_cmd_prefix + [suri(bucket_uri)], return_stdout=True)
    self.assertEquals(stdout, WEBCFG_ERROR)
 
  def test_empty(self):
    bucket_uri = self.CreateBucket()
    self.RunGsUtil(self._set_cmd_prefix + [suri(bucket_uri)])
    stdout = self.RunGsUtil(
        self._get_cmd_prefix + [suri(bucket_uri)], return_stdout=True)
    self.assertEquals(stdout, WEBCFG_EMPTY)

src/g/s/gsutil-HEAD/gslib/tests/test_web.py   gsutil(Download)
    stdout = self.RunGsUtil(
        self._get_cmd_prefix + [suri(bucket_uri)], return_stdout=True)
    self.assertEquals(stdout, WEBCFG_FULL)
 
  def test_main(self):
    bucket_uri = self.CreateBucket()
    self.RunGsUtil(self._set_cmd_prefix + ['-m', 'main', suri(bucket_uri)])
    stdout = self.RunGsUtil(
        self._get_cmd_prefix + [suri(bucket_uri)], return_stdout=True)
    self.assertEquals(stdout, WEBCFG_MAIN)
    stdout = self.RunGsUtil(
        self._get_cmd_prefix + [suri(bucket_uri)], return_stdout=True)
    self.assertEquals(stdout, WEBCFG_ERROR)
 
  def test_empty(self):
    bucket_uri = self.CreateBucket()
    self.RunGsUtil(self._set_cmd_prefix + [suri(bucket_uri)])
    stdout = self.RunGsUtil(
        self._get_cmd_prefix + [suri(bucket_uri)], return_stdout=True)
    self.assertEquals(stdout, WEBCFG_EMPTY)

src/g/s/gsutil-3.42/gslib/tests/test_stat.py   gsutil(Download)
  def test_minus_q_stat(self):
    object_uri = self.CreateObject(contents='z')
    stdout = self.RunGsUtil(['-q', 'stat', suri(object_uri)],
                            return_stdout=True)
    self.assertEquals(0, len(stdout))
    stdout = self.RunGsUtil(['-q', 'stat', suri(object_uri, 'junk')],
                            return_stdout=True, expected_status=1)
    self.assertEquals(0, len(stdout))

src/g/s/gsutil-HEAD/gslib/tests/test_stat.py   gsutil(Download)
  def test_minus_q_stat(self):
    object_uri = self.CreateObject(contents='z')
    stdout = self.RunGsUtil(['-q', 'stat', suri(object_uri)],
                            return_stdout=True)
    self.assertEquals(0, len(stdout))
    stdout = self.RunGsUtil(['-q', 'stat', suri(object_uri, 'junk')],
                            return_stdout=True, expected_status=1)
    self.assertEquals(0, len(stdout))