test KeyError and AttributeError on bad lookups