Skip to content

Instantly share code, notes, and snippets.

@serenamm
Last active September 9, 2019 18:41
Show Gist options
  • Save serenamm/fad8b9d7221d8c39fd095f8b8e48dcc5 to your computer and use it in GitHub Desktop.
Save serenamm/fad8b9d7221d8c39fd095f8b8e48dcc5 to your computer and use it in GitHub Desktop.
def test_make_query_true(mocker):
# Create some fake table paths
test_paths = {
"product_table": {
"table": "products",
},
"similarity_table": {
"table": "product_similarity"
}
}
# Call the function with our paths and "True"
same_category_q = make_query(True, test_paths)
# We want same_category_q to be non-empty
assert same_category_q != ''
def test_make_query_false(mocker):
# As above, create some fake paths
test_paths = {
"product_table": {
"table": "products",
},
"similarity_table": {
"table": "product_similarity"
}
}
same_category_q = make_query(False, test_paths)
# This time, we want same_category_q to be empty
assert same_category_q == ''
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment