Skip to content

Commit

Permalink
test: adds type equivalency check to value_converter test (#630)
Browse files Browse the repository at this point in the history
Co-authored-by: Vinny Senthil <vinnysenthil@gmail.com>
  • Loading branch information
Eric Schmidt and vinnysenthil committed Oct 20, 2021
1 parent f90a1bd commit 3fd0ab7
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions tests/unit/enhanced_library/test_value_converter.py
Expand Up @@ -63,9 +63,7 @@ def test_convert_value_to_message():
actual_from_value_output = value_converter.from_value(SomeMessage, input_value)
expected_type = SomeMessage(input_dict)

# TODO: compare instance of SomeMessage against
# actual_from_value_output.
# See https://github.com/googleapis/python-aiplatform/issues/136
assert actual_from_value_output.__class__.__name__ == SomeMessage.__name__

# Check property-level ("duck-typing") equivalency
assert actual_from_value_output.test_str == expected_type.test_str
Expand All @@ -79,9 +77,7 @@ def test_convert_map_to_message():
map_composite = message_with_map.test_map
actual_output = value_converter.from_map(SomeOutType, map_composite)

# TODO: compare instance of SomeMessage against
# actual_from_value_output.
# See https://github.com/googleapis/python-aiplatform/issues/136
assert actual_output.__class__.__name__ == SomeOutType.__name__

# Check property-to-key/value equivalency
assert actual_output.test_int == map_composite["test_int"]

0 comments on commit 3fd0ab7

Please sign in to comment.