class_docstr: Tests for ImageFolder functions.
code: def test_properties(self):
      images = [
          "root_dir/train/label1/img1.png",
          "root_dir/train/label3/img3.png",
          "root_dir/train/label3/img1.png",
          "root_dir/train/label3/img2.png",
          "root_dir/train/label2/img1.png",
          "root_dir/train/label2/img2.png",
          "root_dir/val/label1/img1.png",
          "root_dir/val/label2/img2.png",
          "root_dir/test/label1/img1.png",
          "root_dir/test/label2/img1.png",
          "root_dir/test/label4/img1.PNG",
          "root_dir/test/label4/unsuported.txt",
      ]
  
      with tfds.testing.MockFs() as fs:
          for file in images:
              fs.add_file(file)
  
          split_examples, labels = image_folder._get_split_label_images(
              "root_dir"
          )
          builder = tfds.ImageFolder(root_dir="root_dir")
          builder_params = tfds.ImageFolder(
              root_dir="root_dir", dtype=tf.uint16, shape=(128, 128, 1)
          )
  
      self.assertEqual(
          split_examples,
          {
              "train": [
                  image_folder._Example(
                      image_path="root_dir/train/label2/img1.png",
                      label="label2",
                  ),
                  image_folder._Example(
                      image_path="root_dir/train/label3/img3.png",
                      label="label3",
                  ),
                  image_folder._Example(
                      image_path="root_dir/train/label3/img2.png",
                      label="label3",
                  ),
                  image_folder._Example(
                      image_path="root_dir/train/label3/img1.png",
                      label="label3",
                  ),
                  image_folder._Example(
                      image_path="root_dir/train/label2/img2.png",
                      label="label2",
                  ),
                  image_folder._Example(
                      image_path="root_dir/train/label1/img1.png",
                      label="label1",
                  ),
              ],
              "val": [
                  image_folder._Example(
                      image_path="root_dir/val/label2/img2.png",
                      label="label2",
                  ),
                  image_folder._Example(
                      image_path="root_dir/val/label1/img1.png",
                      label="label1",
                  ),
              ],
              "test": [
                  image_folder._Example(
                      image_path="root_dir/test/label1/img1.png",
                      label="label1",
                  ),
                  image_folder._Example(
                      image_path="root_dir/test/label2/img1.png",
                      label="label2",
                  ),
                  image_folder._Example(
                      image_path="root_dir/test/label4/img1.PNG",
                      label="label4",
                  ),
              ],
          },
      )
      self.assertEqual(builder.info.splits["train"].num_examples, 6)
      self.assertEqual(builder.info.splits["val"].num_examples, 2)
      self.assertEqual(builder.info.splits["test"].num_examples, 3)
  
      expected_labels = [
          "label1",
          "label2",
          "label3",
          "label4",
      ]
      self.assertEqual(expected_labels, labels)
      self.assertEqual(
          builder.info.features["label"].names, expected_labels
      )
  
      self.assertEqual(
          builder.info.features["image"].shape, (None, None, 3)
      )
      self.assertEqual(builder.info.features["image"].dtype, tf.uint8)
      self.assertEqual(
          builder_params.info.features["image"].shape, (128, 128, 1)
      )
      self.assertEqual(
          builder_params.info.features["image"].dtype, tf.uint16
      )
  
file_path: datasets/tensorflow_datasets/core/folder_dataset/image_folder_test.py
imports: import os
  from unittest import mock
  import tensorflow
  from tensorflow_datasets.core.folder_dataset import image_folder
  import tensorflow_datasets.public_api
label_desc: Use image node_id 1 for calling the ImageFolderFunctionTest obj's underlying member method code with example usage: obj.test_properties() without return types