def test_resolve_name(self): target = "test_name" class Obj_with_name(object): name = target obj = Obj_with_name() self.assertEqual(_resolve_name(obj), target) self.assertEqual(_resolve_name(obj), target) self.assertEqual(_resolve_name(obj.name), target)