git-subtree-dir: fiscal git-subtree-mainline:d95165fc8fgit-subtree-split:102ba84500
16 lines
670 B
Python
16 lines
670 B
Python
from central.app.product_data_provider import result_cache_key
|
|
|
|
|
|
def test_same_classification_inputs_have_same_cache_key():
|
|
first = result_cache_key({"gtin": "789", "description": "X"}, ["12345678"], {"ncm": "v1"}, "prompt-v1", "model-v1")
|
|
second = result_cache_key({"description": "X", "gtin": "789"}, ["12345678"], {"ncm": "v1"}, "prompt-v1", "model-v1")
|
|
|
|
assert first == second
|
|
|
|
|
|
def test_changed_dataset_changes_cache_key():
|
|
first = result_cache_key({"gtin": "789"}, ["12345678"], {"ncm": "v1"}, "prompt-v1", "model-v1")
|
|
second = result_cache_key({"gtin": "789"}, ["12345678"], {"ncm": "v2"}, "prompt-v1", "model-v1")
|
|
|
|
assert first != second
|