code: def test__construct_df():
      """Test pandas dataframe construction"""
      ppdb = PandasMmcif()
      dfs = ppdb._construct_df(three_eiy)
      # assert set(dfs.keys()) == {"OTHERS", "ATOM", "ANISOU", "HETATM"}
      # Currently don't parse OTHERS records as I'm not sure where they're located in mmCIF files
      assert set(dfs.keys()) == {"ATOM", "ANISOU", "HETATM"}
      assert set(dfs["ATOM"].columns) == set(ATOM_DF_COLUMNS)
      assert set(dfs["HETATM"].columns) == set(ATOM_DF_COLUMNS)
      assert set(dfs["ANISOU"].columns) == set(ANISOU_DF_COLUMNS)
      exp = pd.Series(
          [
              52.73,
              2.527,
              54.656,
              -1.667,
              "A",
              "N",
              "SER",
              2,
              "ATOM",
              1,
              None,
              "A",
              "N",
              "SER",
              1,
              "23",
              1.0,
              "None",
              1,
              None,
              "N",
          ],
          index=[
              "B_iso_or_equiv",
              "Cartn_x",
              "Cartn_y",
              "Cartn_z",
              "auth_asym_id",
              "auth_atom_id",
              "auth_comp_id",
              "auth_seq_id",
              "group_PDB",
              "id",
              "label_alt_id",
              "label_asym_id",
              "label_atom_id",
              "label_comp_id",
              "label_entity_id",
              "label_seq_id",
              "occupancy",
              "pdbx_PDB_ins_code",
              "pdbx_PDB_model_num",
              "pdbx_formal_charge",
              "type_symbol",
          ],
      )
      # There's some weird behaviour here I can't quite figure out.
      # Comparing the two series fails on exp.label_alt_id and exp.pdbx_formal_charge
      # However, if I compare these values directly, they are equal.
      # assert exp.equals(dfs["ATOM"].loc[0, :])
      for k, v in exp.items():
          assert dfs["ATOM"].loc[0, :][k] == v, k
  
imports: import os
  from urllib.error import HTTPError
  from urllib.request import urlopen
  from pathlib import Path
  import numpy
  import pandas
  from biopandas.mmcif import PandasMmcif
  from biopandas.pdb import PandasPdb
  from biopandas.testutils import assert_raises
  from nose.tools import raises
  from pandas.testing import assert_frame_equal
label_desc: Use image node_id 6 for calling a global function with example usage: test__construct_df() without return types