-
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.
Merge pull request #453 from skalish/test-cov
Improve test coverage
- Loading branch information
Showing
15 changed files
with
343 additions
and
9 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
18 changes: 18 additions & 0 deletions
18
tests/tamr_client/categorization/test_categorization_project.py
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,18 @@ | ||
import tamr_client as tc | ||
from tests.tamr_client import fake | ||
|
||
|
||
@fake.json | ||
def test_create(): | ||
s = fake.session() | ||
instance = fake.instance() | ||
|
||
project = tc.categorization.project.create( | ||
s, | ||
instance, | ||
name="New Categorization Project", | ||
description="A Categorization Project", | ||
) | ||
assert isinstance(project, tc.CategorizationProject) | ||
assert project.name == "New Categorization Project" | ||
assert project.description == "A Categorization Project" |
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
65 changes: 65 additions & 0 deletions
65
tests/tamr_client/fake_json/categorization/test_categorization_project/test_create.json
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,65 @@ | ||
[ | ||
{ | ||
"request": { | ||
"method": "POST", | ||
"path": "projects", | ||
"json": { | ||
"name": "New Categorization Project", | ||
"type": "CATEGORIZATION", | ||
"unifiedDatasetName": "New Categorization Project_unified_dataset", | ||
"description": "A Categorization Project", | ||
"externalId": null | ||
} | ||
}, | ||
"response": { | ||
"status": 200, | ||
"json": { | ||
"id": "unify://unified-data/v1/projects/2", | ||
"name": "New Categorization Project", | ||
"description": "A Categorization Project", | ||
"type": "CATEGORIZATION", | ||
"unifiedDatasetName": "New Categorization Project_unified_dataset", | ||
"created": { | ||
"username": "admin", | ||
"time": "2018-09-10T16:06:20.636Z", | ||
"version": "created version" | ||
}, | ||
"lastModified": { | ||
"username": "admin", | ||
"time": "2018-09-10T16:06:20.851Z", | ||
"version": "modified version" | ||
}, | ||
"relativeId": "projects/2", | ||
"externalId": "b129f3b1-82f5-4e30-90a3-e562ca977992" | ||
} | ||
} | ||
}, | ||
{ | ||
"request": { | ||
"method": "GET", | ||
"path": "projects/2" | ||
}, | ||
"response": { | ||
"status": 200, | ||
"json": { | ||
"id": "unify://unified-data/v1/projects/2", | ||
"name": "New Categorization Project", | ||
"description": "A Categorization Project", | ||
"type": "CATEGORIZATION", | ||
"unifiedDatasetName": "New Categorization Project_unified_dataset", | ||
"created": { | ||
"username": "admin", | ||
"time": "2018-09-10T16:06:20.636Z", | ||
"version": "created version" | ||
}, | ||
"lastModified": { | ||
"username": "admin", | ||
"time": "2018-09-10T16:06:20.851Z", | ||
"version": "modified version" | ||
}, | ||
"relativeId": "projects/2", | ||
"externalId": "b129f3b1-82f5-4e30-90a3-e562ca977992" | ||
} | ||
} | ||
} | ||
] |
65 changes: 65 additions & 0 deletions
65
tests/tamr_client/fake_json/mastering/test_mastering_project/test_create.json
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,65 @@ | ||
[ | ||
{ | ||
"request": { | ||
"method": "POST", | ||
"path": "projects", | ||
"json": { | ||
"name": "New Mastering Project", | ||
"type": "DEDUP", | ||
"unifiedDatasetName": "New Mastering Project_unified_dataset", | ||
"description": "A Mastering Project", | ||
"externalId": null | ||
} | ||
}, | ||
"response": { | ||
"status": 200, | ||
"json": { | ||
"id": "unify://unified-data/v1/projects/1", | ||
"name": "New Mastering Project", | ||
"description": "A Mastering Project", | ||
"type": "DEDUP", | ||
"unifiedDatasetName": "New Mastering Project_unified_dataset", | ||
"created": { | ||
"username": "admin", | ||
"time": "2018-09-10T16:06:20.636Z", | ||
"version": "created version" | ||
}, | ||
"lastModified": { | ||
"username": "admin", | ||
"time": "2018-09-10T16:06:20.851Z", | ||
"version": "modified version" | ||
}, | ||
"relativeId": "projects/1", | ||
"externalId": "b129f3b1-82f5-4e30-90a3-e562ca977992" | ||
} | ||
} | ||
}, | ||
{ | ||
"request": { | ||
"method": "GET", | ||
"path": "projects/1" | ||
}, | ||
"response": { | ||
"status": 200, | ||
"json": { | ||
"id": "unify://unified-data/v1/projects/1", | ||
"name": "New Mastering Project", | ||
"description": "A Mastering Project", | ||
"type": "DEDUP", | ||
"unifiedDatasetName": "New Mastering Project_unified_dataset", | ||
"created": { | ||
"username": "admin", | ||
"time": "2018-09-10T16:06:20.636Z", | ||
"version": "created version" | ||
}, | ||
"lastModified": { | ||
"username": "admin", | ||
"time": "2018-09-10T16:06:20.851Z", | ||
"version": "modified version" | ||
}, | ||
"relativeId": "projects/1", | ||
"externalId": "b129f3b1-82f5-4e30-90a3-e562ca977992" | ||
} | ||
} | ||
} | ||
] |
65 changes: 65 additions & 0 deletions
65
tests/tamr_client/fake_json/schema_mapping/test_schema_mapping_project/test_create.json
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,65 @@ | ||
[ | ||
{ | ||
"request": { | ||
"method": "POST", | ||
"path": "projects", | ||
"json": { | ||
"name": "New Schema Mapping Project", | ||
"type": "SCHEMA_MAPPING_RECOMMENDATIONS", | ||
"unifiedDatasetName": "New Schema Mapping Project_unified_dataset", | ||
"description": "A Schema Mapping Project", | ||
"externalId": null | ||
} | ||
}, | ||
"response": { | ||
"status": 200, | ||
"json": { | ||
"id": "unify://unified-data/v1/projects/3", | ||
"name": "New Schema Mapping Project", | ||
"description": "A Schema Mapping Project", | ||
"type": "SCHEMA_MAPPING_RECOMMENDATIONS", | ||
"unifiedDatasetName": "New Schema Mapping Project_unified_dataset", | ||
"created": { | ||
"username": "admin", | ||
"time": "2018-09-10T16:06:20.636Z", | ||
"version": "created version" | ||
}, | ||
"lastModified": { | ||
"username": "admin", | ||
"time": "2018-09-10T16:06:20.851Z", | ||
"version": "modified version" | ||
}, | ||
"relativeId": "projects/3", | ||
"externalId": "b129f3b1-82f5-4e30-90a3-e562ca977992" | ||
} | ||
} | ||
}, | ||
{ | ||
"request": { | ||
"method": "GET", | ||
"path": "projects/3" | ||
}, | ||
"response": { | ||
"status": 200, | ||
"json": { | ||
"id": "unify://unified-data/v1/projects/3", | ||
"name": "New Schema Mapping Project", | ||
"description": "A Schema Mapping Project", | ||
"type": "SCHEMA_MAPPING_RECOMMENDATIONS", | ||
"unifiedDatasetName": "New Schema Mapping Project_unified_dataset", | ||
"created": { | ||
"username": "admin", | ||
"time": "2018-09-10T16:06:20.636Z", | ||
"version": "created version" | ||
}, | ||
"lastModified": { | ||
"username": "admin", | ||
"time": "2018-09-10T16:06:20.851Z", | ||
"version": "modified version" | ||
}, | ||
"relativeId": "projects/3", | ||
"externalId": "b129f3b1-82f5-4e30-90a3-e562ca977992" | ||
} | ||
} | ||
} | ||
] |
21 changes: 21 additions & 0 deletions
21
tests/tamr_client/fake_json/test_project/test_create_project_already_exists.json
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,21 @@ | ||
[ | ||
{ | ||
"request": { | ||
"method": "POST", | ||
"path": "projects", | ||
"json": { | ||
"name": "New Mastering Project", | ||
"type": "DEDUP", | ||
"unifiedDatasetName": "New Mastering Project_unified_dataset", | ||
"description": "A Mastering Project", | ||
"externalId": null | ||
} | ||
}, | ||
"response": { | ||
"status": 409, | ||
"json": { | ||
"message": "Can't create project with the requested name 'New Mastering Project' because a project with that name already exists" | ||
} | ||
} | ||
} | ||
] |
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,15 @@ | ||
import tamr_client as tc | ||
from tests.tamr_client import fake | ||
|
||
|
||
@fake.json | ||
def test_create(): | ||
s = fake.session() | ||
instance = fake.instance() | ||
|
||
project = tc.mastering.project.create( | ||
s, instance, name="New Mastering Project", description="A Mastering Project", | ||
) | ||
assert isinstance(project, tc.MasteringProject) | ||
assert project.name == "New Mastering Project" | ||
assert project.description == "A Mastering Project" |
Empty file.
18 changes: 18 additions & 0 deletions
18
tests/tamr_client/schema_mapping/test_schema_mapping_project.py
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,18 @@ | ||
import tamr_client as tc | ||
from tests.tamr_client import fake | ||
|
||
|
||
@fake.json | ||
def test_create(): | ||
s = fake.session() | ||
instance = fake.instance() | ||
|
||
project = tc.schema_mapping.project.create( | ||
s, | ||
instance, | ||
name="New Schema Mapping Project", | ||
description="A Schema Mapping Project", | ||
) | ||
assert isinstance(project, tc.SchemaMappingProject) | ||
assert project.name == "New Schema Mapping Project" | ||
assert project.description == "A Schema Mapping Project" |
Oops, something went wrong.