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

All Samples(16)  |  Call(16)  |  Derive(0)  |  Import(0)
Convenience method for instantiating a testing
instance of StorageUri, without having to specify
bucket_storage_uri_class=mock_storage_service.MockBucketStorageUri.
Also naming the factory method this way makes it clearer in the test
code that StorageUri needs to be set up for testing.

Args, Returns, and Raises are same as for boto.storage_uri(), except there's
no bucket_storage_uri_class arg.

          @staticmethod
  def _test_storage_uri(uri_str, default_scheme='file', debug=0,
                        validate=True):
    """
    Convenience method for instantiating a testing
    instance of StorageUri, without having to specify
    bucket_storage_uri_class=mock_storage_service.MockBucketStorageUri.
    Also naming the factory method this way makes it clearer in the test
    code that StorageUri needs to be set up for testing.

    Args, Returns, and Raises are same as for boto.storage_uri(), except there's
    no bucket_storage_uri_class arg.
    """
    return boto.storage_uri(uri_str, default_scheme, debug, validate,
                            GSMockBucketStorageUri)
        


src/g/s/gsutil-3.42/gslib/tests/test_wildcard_iterator.py   gsutil(Download)
  def testMatchingAllFiles(self):
    """Tests matching all files, based on wildcard"""
    uri = self._test_storage_uri(suri(self.test_dir, '*'))
    actual_uri_strs = set(str(u) for u in
                          self._test_wildcard_iterator(uri).IterUris()
  def testMatchingFileSubset(self):
    """Tests matching a subset of files, based on wildcard"""
    exp_uri_strs = set(
        [suri(self.test_dir, 'abcd'), suri(self.test_dir, 'abdd')])
    uri = self._test_storage_uri(suri(self.test_dir, 'ab??'))
  def testMatchingNonWildcardedUri(self):
    """Tests matching a single named file"""
    exp_uri_strs = set([suri(self.test_dir, 'abcd')])
    uri = self._test_storage_uri(suri(self.test_dir, 'abcd'))
    actual_uri_strs = set(
  def testMatchingFilesIgnoringOtherRegexChars(self):
    """Tests ignoring non-wildcard regex chars (e.g., ^ and $)"""
 
    exp_uri_strs = set([suri(self.test_dir, 'ade$')])
    uri = self._test_storage_uri(suri(self.test_dir, 'ad*$'))
  def testRecursiveDirectoryOnlyWildcarding(self):
    """Tests recursive expansion of directory-only '**' wildcard"""
    uri = self._test_storage_uri(suri(self.test_dir, '**'))
    actual_uri_strs = set(
        str(u) for u in self._test_wildcard_iterator(uri).IterUris())

src/g/s/gsutil-HEAD/gslib/tests/test_wildcard_iterator.py   gsutil(Download)
  def testMatchingAllFiles(self):
    """Tests matching all files, based on wildcard"""
    uri = self._test_storage_uri(suri(self.test_dir, '*'))
    actual_uri_strs = set(str(u) for u in
                          self._test_wildcard_iterator(uri).IterUris()
  def testMatchingFileSubset(self):
    """Tests matching a subset of files, based on wildcard"""
    exp_uri_strs = set(
        [suri(self.test_dir, 'abcd'), suri(self.test_dir, 'abdd')])
    uri = self._test_storage_uri(suri(self.test_dir, 'ab??'))
  def testMatchingNonWildcardedUri(self):
    """Tests matching a single named file"""
    exp_uri_strs = set([suri(self.test_dir, 'abcd')])
    uri = self._test_storage_uri(suri(self.test_dir, 'abcd'))
    actual_uri_strs = set(
  def testMatchingFilesIgnoringOtherRegexChars(self):
    """Tests ignoring non-wildcard regex chars (e.g., ^ and $)"""
 
    exp_uri_strs = set([suri(self.test_dir, 'ade$')])
    uri = self._test_storage_uri(suri(self.test_dir, 'ad*$'))
  def testRecursiveDirectoryOnlyWildcarding(self):
    """Tests recursive expansion of directory-only '**' wildcard"""
    uri = self._test_storage_uri(suri(self.test_dir, '**'))
    actual_uri_strs = set(
        str(u) for u in self._test_wildcard_iterator(uri).IterUris())