def test_find_uniprot_reviewed(self):
     '''Checks that we're actually finding the reviewed entry (Swiss-Prot)
     and not just returning one at random.'''
     entriesMixed = {'TrEMBL':['fake-acc1', 'fake-acc2', 'fake-acc3'],
                     'Swiss-Prot':'P24941'}
     selected2 = mygeneinfo.findReviewedUniprotEntry(entriesMixed, None)
     assert selected2 == 'P24941'
    def test_find_uniprot_without_mygeneinfo(self):
        '''Check that we can pull a reviewed uniprot entry from uniprot
        even if mygene.info doesn't record any. (Note: this test may fail 
        if entrez id 28 returns a different uniprot acc in the future.)'''
        assert u'P16442' == mygeneinfo.findReviewedUniprotEntry('', '28')

    
        
        
        

                             
        
        
 def test_find_uniprot_unexpected(self):
     '''Check that we return an empty unicode string if we're passed 
     an unexpected input'''
     entries = ['foo','bar']
     assert u'' == mygeneinfo.findReviewedUniprotEntry(entries, None)
 def test_find_uniprot_missing(self):
     '''Check that we return an empty unicode string if we are passed 
     an empty string'''
     entries = ''
     assert u'' == mygeneinfo.findReviewedUniprotEntry(entries, None)
 def test_find_uniprot_noreviewed(self):
     '''Check that we can return something even if nothing is reviewed'''
     entriesUnreviewed = {'TrEMBL':'E7ESI2'}
     selected3 = mygeneinfo.findReviewedUniprotEntry(entriesUnreviewed, None)
     assert selected3 == 'E7ESI2'
 def test_find_uniprot_basic(self):
     '''Make sure we find the reviewed entry of the group.'''
     entries = {'Swiss-Prot':'P24941', 'TrEMBL':'E7ESI2'}
     selected = mygeneinfo.findReviewedUniprotEntry(entries, None)
     assert selected == 'P24941'