-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from mfrasca/master
please merge
- Loading branch information
Showing
5 changed files
with
448 additions
and
82 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -55,3 +55,6 @@ docs/_build/ | |
|
||
# PyBuilder | ||
target/ | ||
*~ | ||
*/*~ | ||
*/*/*~ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
try: | ||
from setuptools import setup | ||
except ImportError: | ||
from distutils.core import setup | ||
|
||
config = { | ||
'description': | ||
'convert a tropicos export to a Bauble importable json object', | ||
'author': 'Mario Frasca', | ||
'url': 'URL to get it at.', | ||
'download_url': 'Where to download it.', | ||
'author_email': '[email protected]', | ||
'version': '0.1', | ||
'install_requires': ['nose'], | ||
'packages': ['taxonlist2json'], | ||
'scripts': [], | ||
'name': 'taxonlist2json' | ||
} | ||
|
||
setup(**config) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,75 +1,4 @@ | ||
# -*- coding: utf-8 -*- | ||
|
||
import unittest | ||
from unittest import SkipTest | ||
|
||
import taxonlist2json | ||
|
||
|
||
class ConverterTest(unittest.TestCase): | ||
|
||
def test_file_into_elements(self): | ||
raise SkipTest("not tested yet") | ||
|
||
def test_element_into_lines(self): | ||
'returns only the relevant lines' | ||
raise SkipTest("not tested yet") | ||
|
||
def test_line_to_binomial_with_simple_author(self): | ||
s = ' Abuta velutina Gleason' | ||
result = taxonlist2json.line_to_binomial(s) | ||
expect = {'object': 'taxon', | ||
'rank': 'species', | ||
'epithet': 'velutina', | ||
'ht-rank': 'genus', | ||
'ht-epithet': 'Abuta', | ||
'hybrid': False, | ||
'author': 'Gleason', | ||
} | ||
self.assertEquals(result, expect) | ||
|
||
def test_line_to_binomial_with_composite_author(self): | ||
result = taxonlist2json.line_to_binomial( | ||
'Abutilon mollissimum (Cav.) Sweet') | ||
expect = {'object': 'taxon', | ||
'rank': 'species', | ||
'epithet': 'mollissimum', | ||
'ht-rank': 'genus', | ||
'ht-epithet': 'Abutilon', | ||
'hybrid': False, | ||
'author': '(Cav.) Sweet', | ||
} | ||
self.assertEquals(result, expect) | ||
|
||
def test_line_to_binomial_author_with_utf8_char(self): | ||
s = "Abutilon nudiflorum (L'Hér.) Sweet" | ||
result = taxonlist2json.line_to_binomial(s) | ||
expect = {'ht-epithet': 'Abutilon', | ||
'rank': 'species', | ||
'author': "(L'Hér.) Sweet", | ||
'hybrid': False, | ||
'object': 'taxon', | ||
'epithet': 'nudiflorum', | ||
'ht-rank': 'genus'} | ||
self.assertEquals(result, expect) | ||
|
||
def test_synonym_line_to_objects_pair(self): | ||
s = "Abutilon pulverulentum Ulbrich = "\ | ||
"Sidasodes jamesonii (Baker f. ) Fryxell & Fuertes" | ||
|
||
result = taxonlist2json.synonym_line_to_objects_pair(s) | ||
|
||
expect = ({'ht-epithet': 'Abutilon', 'rank': 'species', | ||
'author': 'Ulbrich', 'hybrid': False, | ||
'object': 'taxon', 'epithet': 'pulverulentum', | ||
'ht-rank': 'genus'}, | ||
{'ht-epithet': 'Sidasodes', | ||
'rank': 'species', | ||
'author': '(Baker f. ) Fryxell & Fuertes', | ||
'hybrid': False, | ||
'object': 'taxon', | ||
'epithet': 'jamesonii', | ||
'ht-rank': 'genus'}) | ||
self.assertEquals(result, expect) | ||
|
||
|
||
# | ||
# this file is here just to make Python understand the folder corresponds to | ||
# a module. |
Oops, something went wrong.