def test__create_weights_list(): weights = ["hello", "world"] weights = stage._create_weights("test__create_weights_none", weights) assert isinstance(weights, dict) assert len(weights) == 2 assert list(sorted(weights.keys())) == sorted(["hello", "world"]) assert all([k == v for k, v in weights.items()])
def test__create_weights_dict(): weights = {"HEY": "hello", "EARTH": "world"} weights = stage._create_weights("test__create_weights_none", weights) assert isinstance(weights, dict) assert len(weights) == 2 assert list(sorted(weights.keys())) == sorted(["HEY", "EARTH"]) assert list(sorted(weights.values())) == sorted(["hello", "world"])
def test__create_weights_single_string(): weights = "dummy_weight" weights = stage._create_weights("test__create_weights_none", weights) assert isinstance(weights, dict) assert len(weights) == 1 assert list(weights.keys()) == ["dummy_weight"] assert all([k == v for k, v in weights.items()])
def test__create_weights_none(): weights = stage._create_weights("test__create_weights_none", None) assert isinstance(weights, dict) assert len(weights) == 0