-
Notifications
You must be signed in to change notification settings - Fork 30
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
1 parent
76a60e8
commit f2411be
Showing
20 changed files
with
409 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
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
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
Empty file.
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,41 @@ | ||
""" | ||
Tests for Code | ||
""" | ||
from datmo.entity.code import Code | ||
|
||
|
||
class TestCode(): | ||
def test_init(self): | ||
input_dict = { | ||
"id": "test", | ||
"model_id": "my_model", | ||
"driver_type": "git", | ||
} | ||
code_entity = Code(input_dict) | ||
|
||
for k, v in input_dict.items(): | ||
assert getattr(code_entity, k) == v | ||
assert code_entity.created_at | ||
assert code_entity.updated_at | ||
|
||
def test_eq(self): | ||
input_dict = { | ||
"id": "test", | ||
"model_id": "my_model", | ||
"driver_type": "git", | ||
} | ||
code_entity_1 = Code(input_dict) | ||
code_entity_2 = Code(input_dict) | ||
assert code_entity_1 == code_entity_2 | ||
|
||
def test_to_dictionary(self): | ||
input_dict = { | ||
"id": "test", | ||
"model_id": "my_model", | ||
"driver_type": "git", | ||
} | ||
code_entity = Code(input_dict) | ||
output_dict = code_entity.to_dictionary() | ||
|
||
for k, v in output_dict.items(): | ||
assert v == getattr(code_entity, k) |
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,49 @@ | ||
""" | ||
Tests for Environment | ||
""" | ||
from datmo.entity.environment import Environment | ||
|
||
|
||
class TestEnvironment(): | ||
def test_init(self): | ||
input_dict = { | ||
"id": "test", | ||
"model_id": "my_model", | ||
"driver_type": "docker", | ||
"file_collection_id": "my_collection", | ||
"definition_filename": "Dockerfile" | ||
} | ||
environment_entity = Environment(input_dict) | ||
|
||
for k, v in input_dict.items(): | ||
assert getattr(environment_entity, k) == v | ||
assert environment_entity.description == "" | ||
assert environment_entity.created_at | ||
assert environment_entity.updated_at | ||
|
||
def test_eq(self): | ||
input_dict = { | ||
"id": "test", | ||
"model_id": "my_model", | ||
"driver_type": "docker", | ||
"file_collection_id": "my_collection", | ||
"definition_filename": "Dockerfile" | ||
} | ||
environment_entity_1 = Environment(input_dict) | ||
environment_entity_2 = Environment(input_dict) | ||
|
||
assert environment_entity_1 == environment_entity_2 | ||
|
||
def test_to_dictionary(self): | ||
input_dict = { | ||
"id": "test", | ||
"model_id": "my_model", | ||
"driver_type": "docker", | ||
"file_collection_id": "my_collection", | ||
"definition_filename": "Dockerfile" | ||
} | ||
environment_entity = Environment(input_dict) | ||
output_dict = environment_entity.to_dictionary() | ||
|
||
for k, v in output_dict.items(): | ||
assert v == getattr(environment_entity, k) |
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,44 @@ | ||
""" | ||
Tests for FileCollection | ||
""" | ||
from datmo.entity.file_collection import FileCollection | ||
|
||
|
||
class TestFileCollection(): | ||
def test_init(self): | ||
input_dict = { | ||
"id": "test", | ||
"model_id": "my_model", | ||
"path": "/path/to/file", | ||
"driver_type": "docker", | ||
} | ||
file_collection_entity = FileCollection(input_dict) | ||
|
||
for k, v in input_dict.items(): | ||
assert getattr(file_collection_entity, k) == v | ||
assert file_collection_entity.created_at | ||
assert file_collection_entity.updated_at | ||
|
||
def test_eq(self): | ||
input_dict = { | ||
"id": "test", | ||
"model_id": "my_model", | ||
"path": "/path/to/file", | ||
"driver_type": "docker", | ||
} | ||
file_collection_entity_1 = FileCollection(input_dict) | ||
file_collection_entity_2 = FileCollection(input_dict) | ||
assert file_collection_entity_1 == file_collection_entity_2 | ||
|
||
def test_to_dictionary(self): | ||
input_dict = { | ||
"id": "test", | ||
"model_id": "my_model", | ||
"path": "/path/to/file", | ||
"driver_type": "docker", | ||
} | ||
file_collection_entity = FileCollection(input_dict) | ||
output_dict = file_collection_entity.to_dictionary() | ||
|
||
for k, v in output_dict.items(): | ||
assert v == getattr(file_collection_entity, k) |
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,40 @@ | ||
""" | ||
Tests for Model | ||
""" | ||
from datmo.entity.model import Model | ||
|
||
|
||
class TestModel(): | ||
def test_init(self): | ||
input_dict = { | ||
"id": "test", | ||
"name": "test" | ||
} | ||
model_entity = Model(input_dict) | ||
|
||
for k, v in input_dict.items(): | ||
assert getattr(model_entity, k) == v | ||
assert model_entity.description == "" | ||
assert model_entity.created_at | ||
assert model_entity.updated_at | ||
|
||
def test_eq(self): | ||
input_dict = { | ||
"id": "test", | ||
"name": "test" | ||
} | ||
model_entity_1 = Model(input_dict) | ||
model_entity_2 = Model(input_dict) | ||
|
||
assert model_entity_1 == model_entity_2 | ||
|
||
def test_to_dictionary(self): | ||
input_dict = { | ||
"id": "test", | ||
"name": "test", | ||
} | ||
model_entity = Model(input_dict) | ||
output_dict = model_entity.to_dictionary() | ||
|
||
for k, v in output_dict.items(): | ||
assert v == getattr(model_entity, k) |
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,42 @@ | ||
""" | ||
Tests for Session | ||
""" | ||
from datmo.entity.session import Session | ||
|
||
|
||
class TestSession(): | ||
def test_init(self): | ||
input_dict = { | ||
"id": "test", | ||
"model_id": "my_model", | ||
"name": "test" | ||
} | ||
session_entity = Session(input_dict) | ||
|
||
for k, v in input_dict.items(): | ||
assert getattr(session_entity, k) == v | ||
assert session_entity.created_at | ||
assert session_entity.updated_at | ||
|
||
def test_eq(self): | ||
input_dict = { | ||
"id": "test", | ||
"model_id": "my_model", | ||
"name": "test" | ||
} | ||
session_entity_1 = Session(input_dict) | ||
session_entity_2 = Session(input_dict) | ||
|
||
assert session_entity_1 == session_entity_2 | ||
|
||
def test_to_dictionary(self): | ||
input_dict = { | ||
"id": "test", | ||
"model_id": "my_model", | ||
"name": "test" | ||
} | ||
session_entity = Session(input_dict) | ||
output_dict = session_entity.to_dictionary() | ||
|
||
for k, v in output_dict.items(): | ||
assert v == getattr(session_entity, k) |
Oops, something went wrong.