def test_member_types(): Pastry = Enumap("Pastry", names="croissant donut muffin") Pastry.set_types(int, int, int, donut=float) # override donut with kwarg assert (Pastry.types() == {'croissant': int, 'donut': float, 'muffin': int})
def test_typless(): """Make sure types are allowed to be blank""" a = Enumap("A", "a b c".split()) b = SparseEnumap("B", "a b c".split()) assert a.types() == {} assert b.types() == {}