Beispiel #1
0
 def test_binomial_to_dict__varietas_with_author(self):
     s = 'Abutilon amplissimum var. subpeltata Ktze.'
     result = taxonlist2json.binomial_to_dict(s)
     expect = {'object': 'taxon',
               'rank': 'varietas',  # should decide name of rank
               'ht-rank': 'species',
               'epithet': 'subpeltata',
               'ht-epithet': 'Abutilon amplissimum',  # COMMENT THIS
               'author': "Ktze.",
               }
     self.assertEquals(result, expect)
 def test_binomial_to_dict__varietas_with_author(self):
     s = 'Abutilon amplissimum var. subpeltata Ktze.'
     result = taxonlist2json.binomial_to_dict(s)
     expect = {'object': 'taxon',
               'rank': 'varietasss',  # should decide name of rank
               'ht-rank': 'species',
               'epithet': 'subpeltata',
               'ht-epithet': 'Abutilon amplissimum',  # COMMENT THIS
               'author': "Ktze.",
               }
     self.assertEquals(result, expect)
 def test_binomial_to_dict__author_with_utf8_char(self):
     s = "Abutilon nudiflorum (L'Hér.) Sweet"
     result = taxonlist2json.binomial_to_dict(s)
     expect = {'ht-epithet': 'Abutilon',
               'rank': 'species',
               'author': u"(L'Hér.) Sweet",
               'hybrid': False,
               'object': 'taxon',
               'epithet': 'nudiflorum',
               'ht-rank': 'genus'}
     self.assertEquals(result, expect)
 def test_binomial_to_dict__author_with_utf8_char(self):
     s = "Abutilon nudiflorum (L'Hér.) Sweet"
     result = taxonlist2json.binomial_to_dict(s)
     expect = {'ht-epithet': 'Abutilon',
               'rank': 'species',
               'author': u"(L'Hér.) Sweet",
               'hybrid': False,
               'object': 'taxon',
               'epithet': 'nudiflorum',
               'ht-rank': 'genus'}
     self.assertEquals(result, expect)
    def test_binomial_to_dict__with_variedad_with_author(self):
        result = taxonlist2json.binomial_to_dict(
            'Abutilon amplissimum var. subpeltata Ktze')
        expect = {'object': 'taxon',
                  'rank': 'variedad',
                  'epithet': 'amplissimum',
                  'ht-rank': 'genus',
                  'ht-epithet': 'Abutilon amplissimum',          
		  'author': 'Ktze',
                  }
        self.assertEquals(result, expect)
 def test_binomial_to_dict__with_composite_author(self):
     result = taxonlist2json.binomial_to_dict(
         '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_binomial_to_dict__with_simple_author(self):
     s = ' Abuta velutina Gleason'
     result = taxonlist2json.binomial_to_dict(s)
     expect = {'object': 'taxon',
               'rank': 'species',
               'epithet': 'velutina',
               'ht-rank': 'genus',
               'ht-epithet': 'Abuta',
               'hybrid': False,
               'author': 'Gleason',
               }
     self.assertEquals(result, expect)
 def test_binomial_to_dict__with_composite_author(self):
     result = taxonlist2json.binomial_to_dict(
         '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_binomial_to_dict__with_simple_author(self):
     s = ' Abuta velutina Gleason'
     result = taxonlist2json.binomial_to_dict(s)
     expect = {'object': 'taxones',
               'rank': 'species',
               'epithet': 'velutina',
               'ht-rank': 'genus',
               'ht-epithet': 'Abuta',
               'hybrid': False,
               'author': 'Gleason',
               }
     self.assertEquals(result, expect)
Beispiel #10
0
 def test_binomial_to_dict__varietas_with_author(self):
     s = "Abutilon amplissimum var. subpeltata Ktze."
     result = taxonlist2json.binomial_to_dict(s)
     expect = {
         "object": "taxon",
         "rank": "varietas",  # should decide name of rank
         "ht-rank": "species",
         "epithet": "subpeltata",
         "ht-epithet": "Abutilon amplissimum",  # COMMENT THIS
         "author": "Ktze.",
     }
     self.assertEquals(result, expect)
Beispiel #11
0
    def test_variedad(self):
        s = "Abutilon amplissimum var. subpeltata Ktze."

        result = taxonlist2json.binomial_to_dict(s)

        expect = ( {'ht-epithet': 'Abutilon',
                    'rank': 'varietas',
                    'author': 'ktze',
                    'hybrid': False,
                    'object': 'taxon',
                    'epithet': 'amplissimum',
                    'ht-rank': 'species'})
        self.assertEquals(result, expect)
    def test_variedad(self):
        s = "Abutilon amplissimum var. subpeltata Ktze."

        result = taxonlist2json.binomial_to_dict(s)

        expect = ( {'ht-epithet': 'Abutilon',
                    'rank': 'varietas',
                    'author': 'ktze',
                    'hybrid': False,
                    'object': 'taxon',
                    'epithet': 'amplissimum',
                    'ht-rank': 'species'})
        self.assertEquals(result, expect)
Beispiel #13
0
    def test_variedad(self):
        s = "Abutilon amplissimum var. subpeltata Ktze."

        result = taxonlist2json.binomial_to_dict(s)

        expect = {
            "ht-epithet": "Abutilon",
            "rank": "varietas",
            "author": "ktze",
            "hybrid": False,
            "object": "taxon",
            "epithet": "amplissimum",
            "ht-rank": "species",
        }
        self.assertEquals(result, expect)