From 17bad90dc4ef91b437c505fea238198c4c3b8fd5 Mon Sep 17 00:00:00 2001 From: Nathan Baker Date: Mon, 18 May 2020 20:37:56 -0700 Subject: [PATCH] Start fixing tests. --- Tests/pkacalc_test.py | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/Tests/pkacalc_test.py b/Tests/pkacalc_test.py index 8fd4e37..5a2f5ca 100644 --- a/Tests/pkacalc_test.py +++ b/Tests/pkacalc_test.py @@ -1,10 +1,12 @@ - +"""Reproduce tests from original PROPKA.""" import os import re from subprocess import call import sys import unittest import logging +import propka.lib +import propka.molecular_container # This error tolerance was chosen to make Ubuntu 18.04 pass under Windows @@ -12,6 +14,22 @@ import logging ACCEPTABLE_ERROR = 0.001 +def run_propka(args): + """Run PROPKA. + + Args: + args: command-line arguments for PROPKA + """ + options = propka.lib.loadOptions() + raise NotImplementedError("Need to incorporated command-line arguments") + pdbfiles = options.filenames + + for pdbfile in pdbfiles: + my_molecule = propka.molecular_container.Molecular_container(pdbfile, options) + my_molecule.calculate_pka() + my_molecule.write_pka() + + # Setting this up as a direct translation of the original runtest.py script # that will be run as part of 'python setup.py test'. This takes on the # order of 10s to run.