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.")