dayrize-usecase/pipeline/beam_etl/tests/test_origin.py

50 lines
1.3 KiB
Python

"""Test the `clean_material_name`"""
from helpers.origin import clean_origin_name
def test_none():
"""Test None value"""
assert clean_origin_name(None) == "mixed"
def test_unexpected():
"""Test an unexpected origin name"""
assert clean_origin_name("foo") == "mixed"
def test_clean_origin_name0():
"""Test a sample input for clean_origin_name"""
assert clean_origin_name(" Assem USA w/foreign/dom. parts") == "mixed"
def test_clean_origin_name1():
"""Test a sample input for clean_origin_name"""
assert clean_origin_name(" Imported") == "imported"
def test_clean_origin_name2():
"""Test a sample input for clean_origin_name"""
assert clean_origin_name(" Made in the USA") == "usa"
def test_clean_origin_name3():
"""Test a sample input for clean_origin_name"""
assert clean_origin_name(" Made in the USA or Imported") == "mixed"
def test_clean_origin_name4():
"""Test a sample input for clean_origin_name"""
assert clean_origin_name(" imported") == "imported"
def test_clean_origin_name5():
"""Test a sample input for clean_origin_name"""
assert clean_origin_name(" made in the USA") == "usa"
def test_clean_origin_name6():
"""Test a sample input for clean_origin_name"""
assert clean_origin_name(" made in the USA or imported") == "mixed"