def test_get_symbols(self): metre = MetricUnit("1", ["m", "meter"], ["m"], ["metre", "meter"]) metre.name = "metre" symbols = list(metre.get_symbols()) assert ("metre", Unit("1")) in symbols assert ("m", Unit("1")) in symbols assert ("meter", Unit("1")) in symbols assert ("km", Unit("1E+3")) in symbols assert ("μm", Unit("1E-6")) in symbols assert ("Kilometre", Unit("1E+3")) in symbols assert ("kilometre", Unit("1E+3")) in symbols assert ("Kilometer", Unit("1E+3")) in symbols assert ("kilometer", Unit("1E+3")) in symbols assert ("nanometer", Unit("1E-9")) in symbols
def test_get_symbols__unique_names(self): metre = MetricUnit("1", ["m", "meter"], ["m"], ["metre", "meter"]) metre.name = "metre" symbols = list(metre.get_symbols()) assert len([k for k, v in symbols]) == len({k for k, v in symbols})