class_docstr: Tests for `tf.data.Dataset.cardinality()`.
class_docstr_tok: ["Tests","for","`","tf.data.Dataset.cardinality","(",")","`","."]
code: def testCardinality(self, dataset_fn, expected_result):
      dataset = dataset_fn()
      self.assertEqual(
          self.evaluate(dataset.cardinality()), expected_result
      )
  
file_path: tensorflow-upstream/tensorflow/python/data/kernel_tests/cardinality_test.py
imports: import functools
  from absl.testing import parameterized
  from tensorflow.python.data.kernel_tests import test_base
  from tensorflow.python.data.ops import dataset_ops
  from tensorflow.python.framework import combinations
  from tensorflow.python.platform import test
label_desc: Use image node_id 1 for calling the CardinalityTest obj's underlying member method code with example usage: obj.testCardinality(dataset_fn, expected_result) without return types