def test_ars_grin_genus_to_dict__rejected(self):
        s = '''\
        <h1 style="font-size: 150%"><a href='taxon/abouttaxonomy.aspx?chapter=scient' target='_blank'>Genus:</a>
         <i>Anomatheca</i>  Ker Gawl.</h1>
        <h2>Synonym of <a href='taxonomygenus.aspx?id=4754'>Freesia Eckl. ex Klatt</a></h2>
					<th>Family:</th>
					<td><i><a href="taxonomyfamily.aspx?id=584">Iridaceae</a></i></td>
					<th>Comments:</th>
					<td>a rejected (nom. rej.), heterotypic synonym (Melbourne ICN Art. 14.4 & App. III) of <I>Freesia</I> Klatt, nom. cons. </td>
'''
        result = taxonlist2json.ars_grin_genus_to_dict(s)
        expect = None
        self.assertEquals(result, expect)
    def test_ars_grin_genus_to_dict__rejected(self):
        s = '''\
        <h1 style="font-size: 150%"><a href='taxon/abouttaxonomy.aspx?chapter=scient' target='_blank'>Genus:</a>
         <i>Anomatheca</i>  Ker Gawl.</h1>
        <h2>Synonym of <a href='taxonomygenus.aspx?id=4754'>Freesia Eckl. ex Klatt</a></h2>
					<th>Family:</th>
					<td><i><a href="taxonomyfamily.aspx?id=584">Iridaceae</a></i></td>
					<th>Comments:</th>
					<td>a rejected (nom. rej.), heterotypic synonym (Melbourne ICN Art. 14.4 & App. III) of <I>Freesia</I> Klatt, nom. cons. </td>
'''
        result = taxonlist2json.ars_grin_genus_to_dict(s)
        expect = None
        self.assertEquals(result, expect)
    def test_ars_grin_genus_to_dict__illegitimate(self):
        s = '''\
        <h1 style="font-size: 150%"><a href='taxon/abouttaxonomy.aspx?chapter=scient' target='_blank'>Genus:</a>
         <i>Petalanthera</i>  Raf.</h1>
        <h2>Synonym of <a href='taxonomygenus.aspx?id=6233'>Justicia L.</a></h2>
					<th>Family:</th>
					<td><i><a href="taxonomyfamily.aspx?id=6">Acanthaceae</a></i></td>
					<th>Comments:</th>
					<td>an illegitimate later homonym (Melbourne ICN Art. 53) of <I>Petalanthera</I> Nees & Mart. (1833) that is unavailable for use </td>
'''
        result = taxonlist2json.ars_grin_genus_to_dict(s)
        expect = None
        self.assertEquals(result, expect)
    def test_ars_grin_genus_to_dict__illegitimate(self):
        s = '''\
        <h1 style="font-size: 150%"><a href='taxon/abouttaxonomy.aspx?chapter=scient' target='_blank'>Genus:</a>
         <i>Petalanthera</i>  Raf.</h1>
        <h2>Synonym of <a href='taxonomygenus.aspx?id=6233'>Justicia L.</a></h2>
					<th>Family:</th>
					<td><i><a href="taxonomyfamily.aspx?id=6">Acanthaceae</a></i></td>
					<th>Comments:</th>
					<td>an illegitimate later homonym (Melbourne ICN Art. 53) of <I>Petalanthera</I> Nees & Mart. (1833) that is unavailable for use </td>
'''
        result = taxonlist2json.ars_grin_genus_to_dict(s)
        expect = None
        self.assertEquals(result, expect)
    def test_ars_grin_genus_to_dict__simple(self):
        s = '''\
	<table class="detail" cellspacing="0" border="0" id="ctl00_cphBody_dvGenus">
		<tr>
			<td colspan="2">
        <h1 style="font-size: 150%"><a href='taxon/abouttaxonomy.aspx?chapter=scient' target='_blank'>Genus:</a>
         <i>Abarema</i>  Pittier</h1>
					<th>Family:</th>
					<td><i><a href="taxonomyfamily.aspx?id=440">Fabaceae</a></i></td>
'''
        result = taxonlist2json.ars_grin_genus_to_dict(s)
        expect = {'object': 'taxon',
                  'rank': 'genus',
                  'epithet': 'Abarema',
                  'ht-rank': 'family',
                  'ht-epithet': 'Fabaceae',
                  'author': 'Pittier',
                  }
        self.assertEquals(result, expect)
    def test_ars_grin_genus_to_dict__simple(self):
        s = '''\
	<table class="detail" cellspacing="0" border="0" id="ctl00_cphBody_dvGenus">
		<tr>
			<td colspan="2">
        <h1 style="font-size: 150%"><a href='taxon/abouttaxonomy.aspx?chapter=scient' target='_blank'>Genus:</a>
         <i>Abarema</i>  Pittier</h1>
					<th>Family:</th>
					<td><i><a href="taxonomyfamily.aspx?id=440">Fabaceae</a></i></td>
'''
        result = taxonlist2json.ars_grin_genus_to_dict(s)
        expect = {'object': 'taxon',
                  'rank': 'genus',
                  'epithet': 'Abarema',
                  'ht-rank': 'family',
                  'ht-epithet': 'Fabaceae',
                  'author': 'Pittier',
                  }
        self.assertEquals(result, expect)
    def test_ars_grin_genus_to_dict__synonym(self):
        s = '''\
        <h1 style="font-size: 150%"><a href='taxon/abouttaxonomy.aspx?chapter=scient' target='_blank'>Genus:</a>
         <i>Dactylanthes</i>  Haw.</h1>
        <h2>Synonym of <a href='taxonomygenus.aspx?id=4515'>Euphorbia L.</a></h2>
					<th>Family:</th>
					<td><i><a href="taxonomyfamily.aspx?id=433">Euphorbiaceae</a></i></td>
'''
        result = taxonlist2json.ars_grin_genus_to_dict(s)
        expect = {'object': 'taxon',
                  'rank': 'genus',
                  'epithet': 'Dactylanthes',
                  'ht-rank': 'family',
                  'ht-epithet': 'Euphorbiaceae',
                  'author': 'Haw.',
                  'accepted': {'author': 'L.',
                               'epithet': 'Euphorbia',
                               'object': 'taxon',
                               'rank': 'genus'},
                  }
        self.assertEquals(result, expect)
    def test_ars_grin_genus_to_dict__synonym(self):
        s = '''\
        <h1 style="font-size: 150%"><a href='taxon/abouttaxonomy.aspx?chapter=scient' target='_blank'>Genus:</a>
         <i>Dactylanthes</i>  Haw.</h1>
        <h2>Synonym of <a href='taxonomygenus.aspx?id=4515'>Euphorbia L.</a></h2>
					<th>Family:</th>
					<td><i><a href="taxonomyfamily.aspx?id=433">Euphorbiaceae</a></i></td>
'''
        result = taxonlist2json.ars_grin_genus_to_dict(s)
        expect = {'object': 'taxon',
                  'rank': 'genus',
                  'epithet': 'Dactylanthes',
                  'ht-rank': 'family',
                  'ht-epithet': 'Euphorbiaceae',
                  'author': 'Haw.',
                  'accepted': {'author': 'L.',
                               'epithet': 'Euphorbia',
                               'object': 'taxon',
                               'rank': 'genus'},
                  }
        self.assertEquals(result, expect)