Skip to content

Commit

Permalink
Drop Python 2-specific code
Browse files Browse the repository at this point in the history
  • Loading branch information
benmwebb committed Mar 1, 2024
1 parent 5b4e50a commit 8e495eb
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions test/frontend/test_submit.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import saliweb.test
import os
import sys
from pathlib import Path
import re
import tempfile
import gzip
Expand All @@ -13,11 +14,9 @@


def make_test_pdb(tmpdir):
os.mkdir(os.path.join(tmpdir, 'xy'))
fh = gzip.open(os.path.join(tmpdir, 'xy', 'pdb1xyz.ent.gz'),
'wb' if sys.version_info[0] == 2 else 'wt')
fh.write("REMARK 6 TEST REMARK\n")
fh.close()
(tmpdir / 'xy').mkdir()
with gzip.open(tmpdir / 'xy' / 'pdb1xyz.ent.gz', 'wt') as fh:
fh.write("REMARK 6 TEST REMARK\n")


class Tests(saliweb.test.TestCase):
Expand Down Expand Up @@ -76,10 +75,10 @@ def test_submit_page_id(self):
cryptosite.app.config['DIRECTORIES_INCOMING'] = incoming

# Make mock PDB database
pdb_root = os.path.join(tmpdir, 'pdb')
os.mkdir(pdb_root)
pdb_root = Path(tmpdir) / 'pdb'
pdb_root.mkdir()
make_test_pdb(pdb_root)
cryptosite.app.config['PDB_ROOT'] = pdb_root
cryptosite.app.config['PDB_ROOT'] = str(pdb_root)

c = cryptosite.app.test_client()
rv = c.post('/job', data={'chain': 'A', 'input_pdbid': '1xyz'})
Expand Down

0 comments on commit 8e495eb

Please sign in to comment.