Skip to content

Commit

Permalink
Fix pyhmmer.tests.test_plan7.test_hmmfile to work with editable ins…
Browse files Browse the repository at this point in the history
…tall
  • Loading branch information
althonos committed Jul 8, 2024
1 parent 0942dc1 commit 307e8af
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions pyhmmer/tests/test_plan7/test_hmmfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,22 +40,22 @@ def test_empty(self):
self.assertRaises(EOFError, self.open_hmm, empty.name)

def test_read_hmmpressed(self):
path = os.path.join(self.hmms_folder, "db", "{}.hmm".format(self.ID))
path = self.hmms_folder.joinpath("db", "{}.hmm".format(self.ID))
with self.open_hmm(path) as f:
self.check_hmmfile(f)

def test_read_h3m(self):
path = os.path.join(self.hmms_folder, "bin", "{}.h3m".format(self.ID))
path = self.hmms_folder.joinpath("bin", "{}.h3m".format(self.ID))
with self.open_hmm(path) as f:
self.check_hmmfile(f)

def test_read_hmm3(self):
path = os.path.join(self.hmms_folder, "txt", "{}.hmm".format(self.ID))
path = self.hmms_folder.joinpath("txt", "{}.hmm".format(self.ID))
with self.open_hmm(path) as f:
self.check_hmmfile(f)

def test_read_hmm2(self):
path = os.path.join(self.hmms_folder, "txt2", "{}.hmm2".format(self.ID))
path = self.hmms_folder.joinpath("txt2", "{}.hmm2".format(self.ID))
with self.open_hmm(path) as f:
self.check_hmmfile(f)

Expand All @@ -68,7 +68,7 @@ def open_hmm(self, path):
return HMMFile(buffer)

def test_name(self):
path = os.path.join(self.hmms_folder, "db", "{}.hmm".format(self.ID))
path = self.hmms_folder.joinpath("db", "{}.hmm".format(self.ID))
with self.open_hmm(path) as f:
self.assertIs(f.name, None)

Expand All @@ -89,12 +89,12 @@ def test_init_error_folder(self):
self.assertRaises(IsADirectoryError, HMMFile, folder)

def test_read_optimized_profiles(self):
path = os.path.join(self.hmms_folder, "db", "{}.hmm".format(self.ID))
path = self.hmms_folder.joinpath("db", "{}.hmm".format(self.ID))
with self.open_hmm(path) as f:
self.check_hmmfile(f.optimized_profiles())

def test_rewind(self):
path = os.path.join(self.hmms_folder, "txt", "{}.hmm".format(self.ID))
path = self.hmms_folder.joinpath("txt", "{}.hmm".format(self.ID))
with self.open_hmm(path) as f:
hmm1 = f.read()
f.rewind()
Expand All @@ -103,7 +103,7 @@ def test_rewind(self):
self.assertEqual(hmm1.name, hmm2.name)

def test_rewind_optimized_profiles(self):
path = os.path.join(self.hmms_folder, "db", "{}.hmm".format(self.ID))
path = self.hmms_folder.joinpath("db", "{}.hmm".format(self.ID))
with self.open_pressed(path) as f:
om1 = f.read()
f.rewind()
Expand All @@ -112,10 +112,10 @@ def test_rewind_optimized_profiles(self):
self.assertEqual(om1.name, om2.name)

def test_name(self):
path = os.path.join(self.hmms_folder, "db", "{}.hmm".format(self.ID))
path = self.hmms_folder.joinpath("db", "{}.hmm".format(self.ID))
with self.open_hmm(path) as f:
self.assertEqual(f.name, path)
self.assertEqual(f.optimized_profiles().name, path)
self.assertEqual(f.name, str(path))
self.assertEqual(f.optimized_profiles().name, str(path))


class _TestThioesterase(_TestHMMFile):
Expand Down

0 comments on commit 307e8af

Please sign in to comment.