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

All Samples(62)  |  Call(62)  |  Derive(0)  |  Import(0)
Fail the test unless the text matches the regular expression.

src/g/s/gsutil-3.42/gslib/tests/test_cp.py   gsutil(Download)
    def _Check1():
      stdout = self.RunGsUtil(['ls', '-L', dsturi], return_stdout=True)
      self.assertRegexpMatches(stdout, 'Content-Type:\s+audio/mpeg')
    _Check1()
 
    def _Check2():
      stdout = self.RunGsUtil(['ls', '-L', dsturi], return_stdout=True)
      self.assertRegexpMatches(stdout, 'Content-Type:\s+image/gif')
    _Check2()
 
    def _Check1():
      stdout = self.RunGsUtil(['ls', '-L', dsturi], return_stdout=True)
      self.assertRegexpMatches(stdout, 'Content-Type:\s+binary/octet-stream')
    _Check1()
 
    def _Check2():
      stdout = self.RunGsUtil(['ls', '-L', dsturi], return_stdout=True)
      self.assertRegexpMatches(stdout, 'Content-Type:\s+binary/octet-stream')
    _Check2()
 
      content_type = ('text/plain' if USE_MAGICFILE
                      else 'application/octet-stream')
      self.assertRegexpMatches(stdout, 'Content-Type:\s+%s' % content_type)
    _Check1()
 

src/g/s/gsutil-HEAD/gslib/tests/test_cp.py   gsutil(Download)
    def _Check1():
      stdout = self.RunGsUtil(['ls', '-L', dsturi], return_stdout=True)
      self.assertRegexpMatches(stdout, 'Content-Type:\s+audio/mpeg')
    _Check1()
 
    def _Check2():
      stdout = self.RunGsUtil(['ls', '-L', dsturi], return_stdout=True)
      self.assertRegexpMatches(stdout, 'Content-Type:\s+image/gif')
    _Check2()
 
    def _Check1():
      stdout = self.RunGsUtil(['ls', '-L', dsturi], return_stdout=True)
      self.assertRegexpMatches(stdout, 'Content-Type:\s+binary/octet-stream')
    _Check1()
 
    def _Check2():
      stdout = self.RunGsUtil(['ls', '-L', dsturi], return_stdout=True)
      self.assertRegexpMatches(stdout, 'Content-Type:\s+binary/octet-stream')
    _Check2()
 
      content_type = ('text/plain' if USE_MAGICFILE
                      else 'application/octet-stream')
      self.assertRegexpMatches(stdout, 'Content-Type:\s+%s' % content_type)
    _Check1()
 

src/g/s/gsutil-3.42/gslib/tests/test_ls.py   gsutil(Download)
    def _Check1():
      stdout = self.RunGsUtil(['ls', '-L', suri(key_uri)], return_stdout=True)
      self.assertRegexpMatches(stdout, r'Content-Encoding:\s+gzip')
      find_content_length_re = r'Content-Length:\s+(?P<num>\d)'
      self.assertRegexpMatches(stdout, find_content_length_re)

src/g/s/gsutil-HEAD/gslib/tests/test_ls.py   gsutil(Download)
    def _Check1():
      stdout = self.RunGsUtil(['ls', '-L', suri(key_uri)], return_stdout=True)
      self.assertRegexpMatches(stdout, r'Content-Encoding:\s+gzip')
      find_content_length_re = r'Content-Length:\s+(?P<num>\d)'
      self.assertRegexpMatches(stdout, find_content_length_re)

src/g/s/gsutil-3.42/gslib/tests/test_acl.py   gsutil(Download)
    xml = self.RunGsUtil(
        self._get_acl_prefix + [suri(self.sample_uri)], return_stdout=True)
    self.assertRegexpMatches(xml, test_regex)
 
    self.RunGsUtil(self._ch_acl_prefix +
                   ['-g', self.GROUP_TEST_ADDRESS+':READ', suri(obj)])
    xml = self.RunGsUtil(self._get_acl_prefix + [suri(obj)], return_stdout=True)
    self.assertRegexpMatches(xml, test_regex)
 
    self.RunGsUtil(self._ch_acl_prefix +
                                 return_stdout=True))
    for xml in xmls:
      self.assertRegexpMatches(xml, test_regex)
 
  def testRecursiveChangeAcl(self):
        ['-R', '-g', self.GROUP_TEST_ADDRESS+':READ', suri(obj)[:-3]])
    xml = self.RunGsUtil(self._get_acl_prefix + [suri(obj)], return_stdout=True)
    self.assertRegexpMatches(xml, test_regex)
 
    self.RunGsUtil(self._ch_acl_prefix +
                   ['-g', self.GROUP_TEST_ADDRESS+':READ', obj_v1])
    xml = self.RunGsUtil(self._get_acl_prefix + [obj_v1], return_stdout=True)
    self.assertRegexpMatches(xml, test_regex)
 
    xml = self.RunGsUtil(self._get_acl_prefix + [obj_v2], return_stdout=True)

src/g/s/gsutil-HEAD/gslib/tests/test_acl.py   gsutil(Download)
    xml = self.RunGsUtil(
        self._get_acl_prefix + [suri(self.sample_uri)], return_stdout=True)
    self.assertRegexpMatches(xml, test_regex)
 
    self.RunGsUtil(self._ch_acl_prefix +
                   ['-g', self.GROUP_TEST_ADDRESS+':READ', suri(obj)])
    xml = self.RunGsUtil(self._get_acl_prefix + [suri(obj)], return_stdout=True)
    self.assertRegexpMatches(xml, test_regex)
 
    self.RunGsUtil(self._ch_acl_prefix +
                                 return_stdout=True))
    for xml in xmls:
      self.assertRegexpMatches(xml, test_regex)
 
  def testRecursiveChangeAcl(self):
        ['-R', '-g', self.GROUP_TEST_ADDRESS+':READ', suri(obj)[:-3]])
    xml = self.RunGsUtil(self._get_acl_prefix + [suri(obj)], return_stdout=True)
    self.assertRegexpMatches(xml, test_regex)
 
    self.RunGsUtil(self._ch_acl_prefix +
                   ['-g', self.GROUP_TEST_ADDRESS+':READ', obj_v1])
    xml = self.RunGsUtil(self._get_acl_prefix + [obj_v1], return_stdout=True)
    self.assertRegexpMatches(xml, test_regex)
 
    xml = self.RunGsUtil(self._get_acl_prefix + [obj_v2], return_stdout=True)

src/g/s/gsutil-3.42/gslib/tests/test_setmeta.py   gsutil(Download)
    def _Check1():
      stdout = self.RunGsUtil(['ls', '-L', objuri], return_stdout=True)
      self.assertRegexpMatches(stdout, 'Content-Type:\s+%s' % ct)
      self.assertRegexpMatches(stdout, 'x-goog-meta-xyz:\s+abc')
    _Check1()
    def _Check1():
      stdout = self.RunGsUtil(['ls', '-L', objuri], return_stdout=True)
      self.assertRegexpMatches(stdout, 'Content-Type:\s+text/html')
      self.assertNotIn('xyz', stdout)
    _Check1()

src/g/s/gsutil-HEAD/gslib/tests/test_setmeta.py   gsutil(Download)
    def _Check1():
      stdout = self.RunGsUtil(['ls', '-L', objuri], return_stdout=True)
      self.assertRegexpMatches(stdout, 'Content-Type:\s+%s' % ct)
      self.assertRegexpMatches(stdout, 'x-goog-meta-xyz:\s+abc')
    _Check1()
    def _Check1():
      stdout = self.RunGsUtil(['ls', '-L', objuri], return_stdout=True)
      self.assertRegexpMatches(stdout, 'Content-Type:\s+text/html')
      self.assertNotIn('xyz', stdout)
    _Check1()

src/g/s/gsutil-3.42/gslib/tests/test_defacl.py   gsutil(Download)
    xml = self.RunGsUtil(self._defacl_get_prefix +
                         [suri(bucket)], return_stdout=True)
    self.assertRegexpMatches(xml, test_regex)
 
  def testChangeMultipleBuckets(self):
    xml = self.RunGsUtil(self._defacl_get_prefix + [suri(bucket1)],
                         return_stdout=True)
    self.assertRegexpMatches(xml, test_regex)
    xml = self.RunGsUtil(self._defacl_get_prefix + [suri(bucket2)],
                         return_stdout=True)
    self.assertRegexpMatches(xml, test_regex)
    xml = self.RunGsUtil(self._defacl_get_prefix + [suri(bucket)],
                         return_stdout=True)
    self.assertRegexpMatches(xml, test_regex_group)
    self.assertRegexpMatches(xml, test_regex_user)
 

src/g/s/gsutil-HEAD/gslib/tests/test_defacl.py   gsutil(Download)
    xml = self.RunGsUtil(self._defacl_get_prefix +
                         [suri(bucket)], return_stdout=True)
    self.assertRegexpMatches(xml, test_regex)
 
  def testChangeMultipleBuckets(self):
    xml = self.RunGsUtil(self._defacl_get_prefix + [suri(bucket1)],
                         return_stdout=True)
    self.assertRegexpMatches(xml, test_regex)
    xml = self.RunGsUtil(self._defacl_get_prefix + [suri(bucket2)],
                         return_stdout=True)
    self.assertRegexpMatches(xml, test_regex)
    xml = self.RunGsUtil(self._defacl_get_prefix + [suri(bucket)],
                         return_stdout=True)
    self.assertRegexpMatches(xml, test_regex_group)
    self.assertRegexpMatches(xml, test_regex_user)
 

  1 | 2  Next