def test_get_current_user(self, getpwuid): """get_current_user returns value from pwd.getpwuid""" getpwuid.return_value = ['mocky'] self.assertEqual(utils.get_current_user(), 'mocky')