This repository has been archived by the owner on Dec 11, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
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 #40 from EcoJulia/bugfix/fullrequest
Fix an edge case bug when the limit was left blank
- Loading branch information
Showing
5 changed files
with
36 additions
and
25 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
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 |
---|---|---|
@@ -0,0 +1,4 @@ | ||
[deps] | ||
DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0" | ||
Query = "1a8c2f83-1ff3-5112-b086-8aa67b057ba1" | ||
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" |
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,21 +1,36 @@ | ||
module TestGBIFRecords | ||
|
||
using GBIF | ||
using Test | ||
using GBIF | ||
using Test | ||
|
||
# Version using pairs | ||
set1 = occurrences("scientificName" => "Mus musculus", "year" => 1999, "hasCoordinate" => true) | ||
@test typeof(set1) == GBIFRecords | ||
@test length(set1) == 20 | ||
# Version using pairs | ||
set1 = occurrences("scientificName" => "Mus musculus", "year" => 1999, "hasCoordinate" => true) | ||
@test typeof(set1) == GBIFRecords | ||
@test length(set1) == 20 | ||
|
||
# Version with no query parameters | ||
set2 = occurrences() | ||
@test typeof(set2) == GBIFRecords | ||
@test length(set2) == 20 | ||
# Version with no query parameters | ||
set2 = occurrences() | ||
@test typeof(set2) == GBIFRecords | ||
@test length(set2) == 20 | ||
|
||
# Version using ranged pairs | ||
set3 = occurrences("scientificName" => "Mus musculus", "year" => 1999, "hasCoordinate" => true, "decimalLatitude" => (0.0,50.0)) | ||
@test typeof(set3) == GBIFRecords | ||
@test length(set3) == 20 | ||
# Version using ranged pairs | ||
set3 = occurrences("scientificName" => "Mus musculus", "year" => 1999, "hasCoordinate" => true, "decimalLatitude" => (0.0, 50.0)) | ||
@test typeof(set3) == GBIFRecords | ||
@test length(set3) == 20 | ||
|
||
# Version with the full query - this one has about 250 records | ||
serval = GBIF.taxon("Leptailurus serval", strict=true) | ||
obs = occurrences(serval, "hasCoordinate" => "true", "continent" => "AFRICA", "decimalLongitude" => (-30, 40)) | ||
while length(obs) < size(obs) | ||
occurrences!(obs) | ||
end | ||
@test length(obs) == size(obs) | ||
|
||
# Version with the full query AND a set page size - this one has about 250 records | ||
obs = occurrences(serval, "hasCoordinate" => "true", "continent" => "AFRICA", "decimalLongitude" => (-30, 40), "limit" => 45) | ||
while length(obs) < size(obs) | ||
occurrences!(obs) | ||
end | ||
@test length(obs) == size(obs) | ||
|
||
end |
cdd2690
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@JuliaRegistrator register()
cdd2690
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Registration pull request created: JuliaRegistries/General/30930
After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.
This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via: