Skip to content

Commit

Permalink
fix default timeout check and simplify
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesmkrieger committed Apr 17, 2024
1 parent 8d64deb commit 9b8a9aa
Showing 1 changed file with 10 additions and 21 deletions.
31 changes: 10 additions & 21 deletions prody/tests/database/test_bioexcel.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@
N_FRAMES_1 = 10
N_FRAMES_2 = 6

TIMEOUT = 120

class TestFetchParseBioexcelPDB(unittest.TestCase):

@classmethod
Expand Down Expand Up @@ -321,7 +319,7 @@ def testReplace(self):
self.assertEqual(checkTimeout(**{'timeout': 50}), 50)

def testDefault(self):
self.assertEqual(checkTimeout(**{}), 60)
self.assertEqual(checkTimeout(**{}), 200)

class TestCheckFrames(unittest.TestCase):
"""Test that checkFrames gives the right errors and outputs."""
Expand Down Expand Up @@ -419,8 +417,7 @@ def testFetchFrames1(self):

try:
a = fetchBioexcelTrajectory(self.query, folder=self.workdir,
frames=self.frames1,
timeout=TIMEOUT)
frames=self.frames1)
except OSError:
pass
else:
Expand Down Expand Up @@ -451,8 +448,7 @@ def testFetchSelectionFrames2(self):

try:
a = fetchBioexcelTrajectory(self.query, folder=self.workdir,
selection='_C', frames=self.frames2,
timeout=TIMEOUT)
selection='_C', frames=self.frames2)
except OSError:
pass
else:
Expand All @@ -470,8 +466,7 @@ def testFetchConvertFalse(self):

try:
a = fetchBioexcelTrajectory(self.query, folder=self.workdir,
convert=False, frames=self.frames1,
timeout=TIMEOUT)
convert=False, frames=self.frames1)
except OSError:
pass
else:
Expand All @@ -493,8 +488,7 @@ def testParseFrames1(self):

try:
ens = parseBioexcelTrajectory(self.query, folder=self.workdir,
frames=self.frames1,
timeout=TIMEOUT)
frames=self.frames1)
except OSError:
pass
else:
Expand All @@ -510,8 +504,7 @@ def testParseSelectionFrames2(self):
using selection='_C'."""
try:
ens = parseBioexcelTrajectory(self.query, folder=self.workdir,
selection='_C', frames=self.frames2,
timeout=TIMEOUT)
selection='_C', frames=self.frames2)
except OSError:
pass
else:
Expand All @@ -526,8 +519,7 @@ def testFetchAndParse(self):
"""Test the outcome of a simple fetch and parse scenario"""
try:
a = fetchBioexcelTrajectory(self.query, folder=self.workdir,
frames=self.frames1,
timeout=TIMEOUT)
frames=self.frames1)
except OSError:
pass
else:
Expand All @@ -544,8 +536,7 @@ def testFetchNoConvParse(self):
"""Test the outcome of a simple fetch, then internally convert and parse scenario."""
try:
a = fetchBioexcelTrajectory(self.query, folder=self.workdir,
convert=False, frames=self.frames1,
timeout=TIMEOUT)
convert=False, frames=self.frames1)
except OSError:
pass
else:
Expand All @@ -562,8 +553,7 @@ def testFetchConvParse(self):
"""Test the outcome of a simple fetch, externally convert and then parse scenario."""
try:
a = fetchBioexcelTrajectory(self.query, folder=self.workdir,
convert=False, frames=self.frames1,
timeout=TIMEOUT)
convert=False, frames=self.frames1)
except OSError:
pass
else:
Expand All @@ -579,8 +569,7 @@ def testFetchConvParse(self):

def testConvertWrongType(self):
with self.assertRaises(TypeError):
fetchBioexcelTrajectory(self.query, folder=self.workdir, convert='False',
timeout=TIMEOUT)
fetchBioexcelTrajectory(self.query, folder=self.workdir, convert='False')

@classmethod
def tearDownClass(cls):
Expand Down

0 comments on commit 9b8a9aa

Please sign in to comment.