Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions tests/test_dna_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,3 +143,19 @@ def test_read_dsrecord_from_json_error(self):
read_dsrecord_from_json(seq)
self.assertEqual(e.exception.status_code, 422)
self.assertIn('The file for sequence with id 1 is not in a valid genbank format: ', e.exception.detail)

def test_read_dsrecord_from_json_with_overhangs(self):
# Name is parsed as well as sequence
with open(f'{test_files}/all_cre_lox.gb', 'r') as f:
content = f.read()
seq = TextFileSequence(
id=1,
file_content=content,
sequence_file_format=SequenceFileFormat('genbank'),
overhang_crick_3prime=1,
overhang_watson_3prime=2,
)
dseqr = read_dsrecord_from_json(seq)
self.assertEqual(dseqr.seq.ovhg, 1)
self.assertEqual(dseqr.seq.watson_ovhg, 2)
self.assertEqual(dseqr.name, 'all_cre_lox')
2 changes: 1 addition & 1 deletion tests/test_files/all_cre_lox.gb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
LOCUS name 136 bp DNA linear UNK 01-JAN-1980
LOCUS all_cre_lox 136 bp DNA linear UNK 01-JAN-1980
DEFINITION description.
ACCESSION id
VERSION id
Expand Down