Skip to content
  • Oliver Smart's avatar
    Test process_components_cif with a filename that cannot exist. · 71ff6708
    Oliver Smart authored
    For issue #17 process_components_cif script to read complete components.cif and produce PDBeChem ftp area
    
    Currently fails test - because specifying output directory as None - currently not allowed:
    
            (new-rdkit-env3) [osmart@swannandrh6d pdbeccdutils]$ nosetests /ebi/msd/work2/osmart/ccd_utils/pdbeccdutils/tests/test_process_components_cif_cli.py
            usage: nosetests [-h] [--debug] COMPONENTS_CIF OUTPUT_DIR
            nosetests: error: the following arguments are required: COMPONENTS_CIF, OUTPUT_DIR
            .E...................................................................................................................
            ======================================================================
            ERROR: tests.test_process_components_cif_cli.test_input_file_that_cannot_exist_raises_system_exit
            ----------------------------------------------------------------------
            Traceback (most recent call last):
              File "/ebi/msd/work2/osmart/conda/envs/new-rdkit-env3/lib/python3.5/site-packages/nose/case.py", line 198, in runTest
                self.test(*self.arg)
              File "/ebi/msd/work2/osmart/ccd_utils/pdbeccdutils/tests/test_process_components_cif_cli.py", line 24, in test_input_file_that_cannot_exist_raises_system_exit
                output_dir=None, debug=False))
              File "/nfs/msd/work2/osmart/ccd_utils/pdbeccdutils/process_components_cif_cli.py", line 81, in process_components_cif
                create_directory_using_mkdir_unless_it_exists(output_dir)
              File "/nfs/msd/work2/osmart/ccd_utils/pdbeccdutils/utilities.py", line 27, in create_directory_using_mkdir_unless_it_exists
                os.mkdir(path)
            TypeError: mkdir: can't specify None for path argument
            -------------------- >> begin captured logging << --------------------
             : DEBUG: components_cif=/////impossible_to_open_file output_dir=None
            --------------------- >> end captured logging << ---------------------
    
            ----------------------------------------------------------------------
            Ran 117 tests in 2.090s
    
            FAILED (errors=1)
    71ff6708