796ee31d0acdc99b845e44b430451d6b0c87ee27,tensorflow_datasets/core/download/download_manager_test.py,DownloadManagerTest,test_download_and_extract_archive_ext_in_fname,#DownloadManagerTest#,243

Before Change


    url = "http://a?key=1234"
    content = "content from zip file"
    resource = resource_lib.Resource(url=url)
    resource.sha256 = _sha256(content)
    self.file_names[resource.fname] = "a.zip"
    dl, self.dl_results[url] = _get_promise_on_event((resource.sha256, 20))
    ext, self.extract_results["/dl_dir/%s" % resource.fname] = (
        _get_promise_on_event("/extract_dir/ZIP.%s" % resource.fname))
    dl.set()

After Change


  def test_download_and_extract_archive_ext_in_fname(self):
    // Make sure extraction method is properly deduced from original fname, and
    // not from URL.
    a = Artifact("a", url="http://a?key=1234")
    self.file_names[a.resource_sha.fname] = "a.zip"
    dl, self.dl_results[a.url] = _get_promise_on_event(a.checksum_size)
    ext, self.extract_results["/dl_dir/%s" % a.resource_sha.fname] = (
        _get_promise_on_event("/extract_dir/ZIP.%s" % a.resource_sha.fname))
    dl.set()
    ext.set()
    manager = self._get_manager(checksums={
        a.url: a.size_checksum,
    })
    res = manager.download_and_extract({"a": a.url})
    expected = {
        "a": "/extract_dir/ZIP.%s" % a.resource_sha.fname,
    }
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 10

Instances


Project Name: tensorflow/datasets
Commit Name: 796ee31d0acdc99b845e44b430451d6b0c87ee27
Time: 2019-03-17
Author: pierrot@google.com
File Name: tensorflow_datasets/core/download/download_manager_test.py
Class Name: DownloadManagerTest
Method Name: test_download_and_extract_archive_ext_in_fname


Project Name: tensorflow/datasets
Commit Name: 796ee31d0acdc99b845e44b430451d6b0c87ee27
Time: 2019-03-17
Author: pierrot@google.com
File Name: tensorflow_datasets/core/download/download_manager_test.py
Class Name: DownloadManagerTest
Method Name: test_download_and_extract_archive_ext_in_fname


Project Name: tensorflow/datasets
Commit Name: 796ee31d0acdc99b845e44b430451d6b0c87ee27
Time: 2019-03-17
Author: pierrot@google.com
File Name: tensorflow_datasets/core/download/download_manager_test.py
Class Name: DownloadManagerTest
Method Name: test_wrong_checksum


Project Name: tensorflow/datasets
Commit Name: 796ee31d0acdc99b845e44b430451d6b0c87ee27
Time: 2019-03-17
Author: pierrot@google.com
File Name: tensorflow_datasets/core/download/download_manager_test.py
Class Name: DownloadManagerTest
Method Name: test_force_download_and_extract