While Hufflepuffs are stereotyped to be the optimistic and friendly House, that is not in our traits. As long as you still consider yourself loyal and hard working and fair or as long as you value those traits above the traits in the other Houses, you are a Hufflepuff. Don’t let the stereotypes of the Houses dictate where you feel you belong, especially since they usually aren’t right. (Piss off a Hufflepuff and see how long they remain friendly).
I know Hufflepuffs in all sorts of situations, some similar and some not, and they are all super loyal and stick together like glue.