im_dir = os.getcwd() + "/im_dir/"
os.mkdir(im_dir)
try:
_ImageNet(1).sample_synset_links(wnid, n, im_dir)
n_images = len(os.listdir(im_dir + "/" + wnid))
assert n == n_images, "Did not download n images"
assert wnid in os.listdir(im_dir), "Did not get the requested synset"
After Change
def test_sample_synset_links(self):
n = 5
wnid = "n02114855"
os.mkdir(conf["out_path"])
try:
self.image_net.sample_synset_links(wnid, n, conf["out_path"])
n_images = len(os.listdir(conf["out_path"] + "/" + wnid))