-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
27 additions
and
24 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
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,23 +1,26 @@ | ||
# """Tests for registry module - nodes methods""" | ||
# import os | ||
# from pygbif import registry | ||
"""Tests for registry module - nodes methods""" | ||
import os | ||
from pygbif import registry | ||
|
||
# def test_nodes(): | ||
# "Basic test of registry.nodes" | ||
# res = registry.nodes() | ||
# assert 'dict' == res.__class__.__name__ | ||
# assert 5 == len(res) | ||
# assert [u'count', u'endOfRecords', u'limit', u'results', u'offset'] == res.keys() | ||
def test_nodes(): | ||
"Basic test of registry.nodes" | ||
res = registry.nodes() | ||
assert dict == res.__class__ | ||
assert 2 == len(res) | ||
assert 100 == len(res['data']) | ||
assert ['meta', 'data'] == res.keys() | ||
|
||
# def test_nodes_limit(): | ||
# "limit param in registry.nodes" | ||
# res = registry.nodes(limit=5) | ||
# assert 'dict' == res.__class__.__name__ | ||
# assert 24 == len(res) | ||
# assert 252408386 == res['key'] | ||
def test_nodes_limit(): | ||
"limit param in registry.nodes" | ||
res = registry.nodes(limit=5) | ||
assert dict == res.__class__ | ||
assert 5 == len(res['data']) | ||
|
||
# def test_nodes_return(): | ||
# "data param in registry.nodes" | ||
# res = registry.nodes(taxonKey = 1052909293) | ||
# assert 'dict' == res.__class__.__name__ | ||
# assert 5 == len(res) | ||
def test_nodes_return(): | ||
"data param in registry.nodes" | ||
res = registry.nodes(data='identifier', uuid="03e816b3-8f58-49ae-bc12-4e18b358d6d9") | ||
assert dict == res.__class__ | ||
assert 2 == len(res) | ||
assert 1 == len(res['data']) | ||
assert 5 == len(res['data'][0]) | ||
assert 'identifier' in res['data'][0].keys() |