Skip to content

Commit

Permalink
Add URL to resource entity
Browse files Browse the repository at this point in the history
  • Loading branch information
shal committed Jan 11, 2020
1 parent bb1dc2d commit f325d57
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 23 deletions.
1 change: 1 addition & 0 deletions client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 50,7 @@ func TestClient_ResourceShow(t *testing.T) {
ID: "1235678-1234-1234-1234-000123456789",
LastModified: LastModifiedTime{timestamp.Add(12 * time.Hour)},
Name: "example.json",
URL: "https://data.gov.ua/dataset/00000000-0000-0000-0000-00000000000/resource/1235678-1234-1234-1234-000123456789/download/example.json",
Revisions: []Revision{
{
ID: "12112019_2",
Expand Down
24 changes: 1 addition & 23 deletions subscription_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,32 67,10 @@ func TestSubscribePackage(t *testing.T) {
timestamp, err := time.Parse(ResourceCreatedTimeFormat, "2019-11-12 01:00:00")
require.NoError(t, err)

// expected := []Revision{
// {
// ID: "12112019_2",
// ResourceID: "1235678-1234-1234-1234-000123456789",
// MimeType: "application/json",
// Name: "example.json",
// Format: "JSON",
// URL: "https://data.gov.ua/dataset/00000000-0000-0000-0000-000000000000/resource/1235678-1234-1234-1234-000123456789/revision/12112019_2",
// ResourceCreated: ResourceCreatedTime{timestamp.Add(12 * time.Hour)},
// Size: 10000000,
// },
// {
// ID: "12112019_1",
// ResourceID: "1235678-1234-1234-1234-000123456789",
// MimeType: "application/json",
// Name: "example.json",
// Format: "JSON",
// URL: "https://data.gov.ua/dataset/00000000-0000-0000-0000-000000000000/resource/1235678-1234-1234-1234-000123456789/revision/12112019_1",
// ResourceCreated: ResourceCreatedTime{timestamp},
// Size: 20000000,
// },
// }

expected := Resource{
ID: "1235678-1234-1234-1234-000123456789",
Name: "example.json",
URL: "https://data.gov.ua/dataset/00000000-0000-0000-0000-00000000000/resource/1235678-1234-1234-1234-000123456789/download/example.json",
Revisions: []Revision{
{
ID: "12112019_2",
Expand Down
1 change: 1 addition & 0 deletions test/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 8,7 @@
"package_id": "00000000-0000-0000-0000-000000000000",
"id": "1235678-1234-1234-1234-000123456789",
"last_modified": "2019-11-12T13:00:00.000000",
"url": "https://data.gov.ua/dataset/00000000-0000-0000-0000-00000000000/resource/1235678-1234-1234-1234-000123456789/download/example.json",
"name": "example.json"
}
]
Expand Down
1 change: 1 addition & 0 deletions test/resource.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 6,7 @@
"id": "1235678-1234-1234-1234-000123456789",
"last_modified": "2019-11-12T13:00:00.000000",
"name": "example.json",
"url": "https://data.gov.ua/dataset/00000000-0000-0000-0000-00000000000/resource/1235678-1234-1234-1234-000123456789/download/example.json",
"resource_revisions": [
{
"mimetype": "application/json",
Expand Down
1 change: 1 addition & 0 deletions types.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 23,7 @@ type Resource struct {
Name string `json:"name"`
Revisions []Revision `json:"resource_revisions"`
PackageID string `json:"package_id"`
URL string `json:"url"`
LastModified LastModifiedTime `json:"last_modified"`
}

Expand Down

0 comments on commit f325d57

Please sign in to comment.