Skip to content

Commit

Permalink
add testcase
Browse files Browse the repository at this point in the history
  • Loading branch information
gaurav274 committed Oct 17, 2023
1 parent 7c8b6da commit b6affcf
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions test/integration_tests/long/test_function_executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,20 +199,29 @@ def test_should_create_function_with_metadata(self):
OUTPUT (label NDARRAY STR(10))
TYPE Classification
IMPL 'test/util.py'
CACHE 'TRUE'
BATCH 'FALSE';
CACHE TRUE
BATCH FALSE
INT_VAL 1
FLOAT_VAL 1.5
STR_VAL "gg";
"""
execute_query_fetch_all(self.evadb, create_function_query.format(function_name))

# try fetching the metadata values
entries = self.evadb.catalog().get_function_metadata_entries_by_function_name(
function_name
)
self.assertEqual(len(entries), 2)
self.assertEqual(len(entries), 5)
metadata = [(entry.key, entry.value) for entry in entries]

# metadata ultimately stored as lowercase string literals in metadata
expected_metadata = [("cache", "TRUE"), ("batch", "FALSE")]
expected_metadata = [
("cache", True),
("batch", False),
("int_val", 1),
("float_val", 1.5),
("str_val", "gg"),
]
self.assertEqual(set(metadata), set(expected_metadata))

def test_should_return_empty_metadata_list_for_missing_function(self):
Expand Down

0 comments on commit b6affcf

Please sign in to comment.