Example #1
0
    def test_write_and_read(self):
        # TODO(b/123241798): use TEST_TMPDIR
        basedir = tempfile.mkdtemp()
        original = dataset_metadata.DatasetMetadata(
            schema=test_common.get_test_schema())

        metadata_io.write_metadata(original, basedir)
        reloaded = metadata_io.read_metadata(basedir)

        self.assertEqual(original, reloaded)
    def test_write_and_read(self):
        basedir = tempfile.mkdtemp()
        original = dataset_metadata.DatasetMetadata(
            schema=test_common.get_test_schema())

        metadata_io.write_metadata(original, basedir, versions=_test_versions)
        reloaded = metadata_io.read_metadata(basedir, versions=_test_versions)

        generated_feature_spec = reloaded.schema.as_feature_spec()
        self.assertEqual(test_common.test_feature_spec, generated_feature_spec)
Example #3
0
    def test_write_and_read(self):
        # TODO(b/123241798): use TEST_TMPDIR
        basedir = tempfile.mkdtemp()
        original = dataset_metadata.DatasetMetadata(
            schema=test_common.get_test_schema())

        metadata_io.write_metadata(original, basedir)
        reloaded = metadata_io.read_metadata(basedir)

        generated_feature_spec = reloaded.schema.as_feature_spec()
        self.assertEqual(test_common.test_feature_spec, generated_feature_spec)
 def test_sanity(self):
     metadata = dataset_metadata.DatasetMetadata.from_feature_spec(
         test_common.test_feature_spec)
     self.assertEqual(metadata.schema, test_common.get_test_schema())