mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-06-08 11:17:27 +00:00
22 lines
779 B
Python
22 lines
779 B
Python
from epc_data.attributes.attribute_utils import extract_thermal_transmittance, clean_description
|
|
|
|
|
|
def test_extract_thermal_transmittance():
|
|
description = "average thermal transmittance 2.3 w/m-¦k"
|
|
assert extract_thermal_transmittance({}, description) == (
|
|
{'thermal_transmittance': 2.3, 'thermal_transmittance_unit': 'w/m-¦k'}, '')
|
|
|
|
|
|
def test_clean_description():
|
|
test_cases = [
|
|
("this:is;a*test", "this is a test"),
|
|
("hello@world", "hello world"),
|
|
("what?!?", "what "),
|
|
("hello(world)", "hello world "),
|
|
("", ""),
|
|
(":;*@?!", " "),
|
|
("no special chars", "no special chars")
|
|
]
|
|
|
|
for input_str, expected_output in test_cases:
|
|
assert clean_description(input_str) == expected_output
|