ed03b82fe98b3d2f249f56d4903a107904acfe66,tensorflow_datasets/testing/dataset_builder_testing.py,DatasetBuilderTestCase,_test_checksums,#DatasetBuilderTestCase#,286

Before Change


        self._test_checksums()

  def _test_checksums(self):
    urls = []
    // how to get the path to the checksum file corresponding to the testcase.
    filepath = os.path.join(download.checksums._get_path(os.path.basename(self.example_dir)))
    if tf.io.gfile.exists(filepath):
      with tf.io.gfile.GFile(filepath, "r") as f:
        for line in f.readlines():
          urls.append(line.split()[0])
    else:
      raise AssertionError("url checksums file not found at %s" % filepath)

    self.assertTrue(self._download_urls.issubset(set(urls)), "url checksums don"t match.")

After Change


  def _test_checksums(self):
    filepath = os.path.join(checksums._get_path(self.builder.name))
    if tf.io.gfile.exists(filepath):
      sizes_checksums = checksums._get_sizes_checksums(filepath)
      urls = sizes_checksums.keys()
    else:
      raise AssertionError("url checksums file not found at %s" % filepath)

    self.assertTrue(self._download_urls.issubset(set(urls)), "url checksums don"t match.")
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 8

Instances


Project Name: tensorflow/datasets
Commit Name: ed03b82fe98b3d2f249f56d4903a107904acfe66
Time: 2020-03-22
Author: cs17btech11040@iith.ac.in
File Name: tensorflow_datasets/testing/dataset_builder_testing.py
Class Name: DatasetBuilderTestCase
Method Name: _test_checksums


Project Name: pantsbuild/pants
Commit Name: d1f9001d62b5ba6af5e9c63f70ab3cb39017d311
Time: 2018-08-01
Author: stuhood@twitter.com
File Name: src/python/pants/backend/python/interpreter_cache.py
Class Name: PythonInterpreterCache
Method Name: select_interpreter_for_targets


Project Name: pantsbuild/pants
Commit Name: 30dda3a132d6d74bed81fd51144a7247d02cea9a
Time: 2015-11-30
Author: zundel@squareup.com
File Name: src/python/pants/backend/core/tasks/reflect.py
Class Name:
Method Name: gen_tasks_options_reference_data