def test_no_metadata(self): tempdir = tempfile.mkdtemp() table = Table("titanic") table.attributes = OrderedDict() fname = path.join(tempdir, "out.tab") TabReader.write_table_metadata(fname, table) self.assertFalse(path.isfile(fname + ".metadata")) shutil.rmtree(tempdir)
def test_no_metadata(self): tempdir = tempfile.mkdtemp() try: self.data.attributes = OrderedDict() fname = path.join(tempdir, "out.tab") TabReader.write_table_metadata(fname, self.data) self.assertFalse(path.isfile(fname + ".metadata")) finally: shutil.rmtree(tempdir)
def test_no_metadata(self): tempdir = tempfile.mkdtemp() try: self.data.attributes = OrderedDict() fname = path.join(tempdir, "out.tab") TabReader.write_table_metadata(fname, self.data) self.assertFalse(path.isfile(fname + ".metadata")) finally: shutil.rmtree(tempdir)
def test_had_metadata_now_there_is_none(self): tempdir = tempfile.mkdtemp() try: self.data.attributes["a"] = "aa" fname = path.join(tempdir, "out.tab") TabReader.write_table_metadata(fname, self.data) self.assertTrue(path.isfile(fname + ".metadata")) del self.data.attributes["a"] TabReader.write_table_metadata(fname, self.data) self.assertFalse(path.isfile(fname + ".metadata")) finally: shutil.rmtree(tempdir)
def test_metadata(self): tempdir = tempfile.mkdtemp() try: table = Table("titanic") table.attributes = OrderedDict() table.attributes["a"] = "aa" table.attributes["b"] = "bb" fname = path.join(tempdir, "out.tab") TabReader.write_table_metadata(fname, table) self.assertTrue(path.isfile(fname + ".metadata")) finally: shutil.rmtree(tempdir)
def test_metadata(self): tempdir = tempfile.mkdtemp() try: table = Table("titanic") table.attributes = OrderedDict() table.attributes["a"] = "aa" table.attributes["b"] = "bb" fname = path.join(tempdir, "out.tab") TabReader.write_table_metadata(fname, table) self.assertTrue(path.isfile(fname + ".metadata")) finally: shutil.rmtree(tempdir)
def test_had_metadata_now_there_is_none(self): tempdir = tempfile.mkdtemp() try: self.data.attributes["a"] = "aa" fname = path.join(tempdir, "out.tab") TabReader.write_table_metadata(fname, self.data) self.assertTrue(path.isfile(fname + ".metadata")) del self.data.attributes["a"] TabReader.write_table_metadata(fname, self.data) self.assertFalse(path.isfile(fname + ".metadata")) finally: shutil.rmtree(tempdir)