method  get keys  has common cases  you covered only two of them  here is list of cases that should be covered by tests self extra specs is none and prefer resource data is true self extra specs is none and prefer resource data is false self extra specs is dict with data and prefer resource data is true self extra specs is dict with data and prefer resource data is false