コード例 #1
0
    def test_renames_when_num_cols_equals_num_names(self):
        svr_table = Table(data=[[1, 1], [1, 1]])
        svr_table.meta["comments"] = ["# name other"]

        renamed_tbl = sim_db.rename_table_colnames(svr_table)
        assert renamed_tbl.colnames[0] == "name"
        assert renamed_tbl.colnames[1] == "other"
コード例 #2
0
    def test_throws_exception_when_not_enough_column_names(self):
        svr_table = Table(data=[[1, 1], [1, 1]])
        svr_table.meta["comments"] = ["# name"]

        with pytest.raises(Exception):
            sim_db.rename_table_colnames(svr_table)