Skip to content

Commit

Permalink
no need to check if current gene_code is different
Browse files Browse the repository at this point in the history
  • Loading branch information
carlosp420 committed Feb 4, 2015
1 parent 6c8fc34 commit ad2177b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
9 changes: 7 additions & 2 deletions voseq/create_dataset/tests/tests_utils.py
Expand Up @@ -28,9 +28,10 @@ def setUp(self):

self.c = Client()
self.dataset_creator = CreateDataset(self.cleaned_data)
self.maxDiff = None

def test_create_dataset(self):
expected = '>CP100-10_Papilionoidea_Melitaea_diamina'
expected = '>coi\n--------------------\n>CP100-10_Papilionoidea_Melitaea_diamina'
result = self.dataset_creator.dataset_str
self.assertTrue(expected in result)

Expand All @@ -47,9 +48,13 @@ def test_get_taxon_names_for_taxa(self):
'cp100-11': {'code': 'CP100-11', 'genus': 'Melitaea', 'species': 'diamina', 'superfamily': ''},
}
result = self.dataset_creator.get_taxon_names_for_taxa()

self.assertEqual(expected, result)

def test_from_seq_objs_to_fasta(self):
expected = 2706
result = self.dataset_creator.from_seq_objs_to_fasta()
self.assertEqual(expected, len(result))

def test_get_taxon_names_for_taxa_additional_fields(self):
self.cleaned_data['taxon_names'] = ['SUPERFAMILY']
dataset_creator = CreateDataset(self.cleaned_data)
Expand Down
4 changes: 0 additions & 4 deletions voseq/create_dataset/utils.py
Expand Up @@ -82,10 +82,6 @@ def from_seq_objs_to_fasta(self):
this_gene = seq_record.name
seq_str = '>' + this_gene + '\n' + '--------------------'
append(seq_str)
if this_gene != seq_record.name:
this_gene = seq_record.name
seq_str = '>' + this_gene + '\n' + '--------------------'
append(seq_str)
seq_record_seq_str = str(self.get_sequence_based_on_codon_positions(this_gene, seq_record.seq))
seq_str = '>' + seq_record.id + '\n' + seq_record_seq_str
append(seq_str)
Expand Down

0 comments on commit ad2177b

Please sign in to comment.