It's called personification.
The term for assigning human attributes is anthropomorphism. Examples are fables and animal cartoons.
personification
personification or anthropomorphism
When an author gives human qualities to an animal in a story they anthropomorphize it.
Actually, personification gives human qualities to non-human things.
something that has human like qualities
Actually, personification gives human qualities to non-human things.
That is called personification.
Personifaction.
Personification
Anthropomorphizing
The term you are looking for is "Pathetic Fallacy".