Skip to content

Commit

Permalink
chore: rename main function
Browse files Browse the repository at this point in the history
  • Loading branch information
breakthewall committed Oct 24, 2023
1 parent c4c4c9c commit bbf9948
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions taxonid/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from .Args import (
build_args_parser,
)
from .taxonid import get_taxon_id
from .taxonid import get_taxonid


def init(
Expand Down Expand Up @@ -48,7 +48,7 @@ def entry_point():

logger = init(parser, args)

taxon_id = get_taxon_id(org_name=args.org_name, logger=logger)
taxon_id = get_taxonid(org_name=args.org_name, logger=logger)
print(taxon_id)

if args.output_file is not None:
Expand Down
2 changes: 1 addition & 1 deletion taxonid/taxonid.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from Bio import Entrez


def get_taxon_id(org_name: str, logger: Logger = getLogger(__name__)) -> int:
def get_taxonid(org_name: str, logger: Logger = getLogger(__name__)) -> int:
"""Get taxon ID from NCBI taxonomy database
:param org_name: Name of the organism
Expand Down
6 changes: 3 additions & 3 deletions tests/test_taxonid.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
from unittest import TestCase

from taxonid.taxonid import get_taxon_id
from taxonid.taxonid import get_taxonid


class TestTaxonID(TestCase):

def test_taxonid(self):
self.assertEqual(
511145,
get_taxon_id('Escherichia coli str. K-12 substr. MG1655')
get_taxonid('Escherichia coli str. K-12 substr. MG1655')
)

def test_taxonid_error(self):
self.assertEqual(
-1,
get_taxon_id('foo')
get_taxonid('foo')
)

0 comments on commit bbf9948

Please sign in to comment.