def test_user_gateway_get_share(self):
        """Test UserGateway get_share methods."""
        wrong_share = self.factory.make_share(
            subtree=self.rw_node, shared_to=self.othersharee,
            name='WriteShare', access=Share.VIEW)
        # test with a share offer
        shareoffer = self.factory.make_share(
            subtree=self.r_node, name='offer', email='fake@example.com')
        so = self.sharer._gateway.get_share(shareoffer.id, accepted_only=False)
        self.assertEqual(so.id, shareoffer.id)
        self.assertEqual(so.shared_to, None)
        self.assertEqual(so.shared_by.id, self.sharer.id)
        self.assertEqual(so.offered_to_email, shareoffer.email)
        rw_share = self.user._gateway.get_share(self.rw_share.id)
        self.assertEqual(rw_share.id, self.rw_share.id)
        self.assertEqual(rw_share.shared_to.id, self.user.id)
        self.assertEqual(rw_share.shared_by.id, self.sharer.id)
        r_share = self.user._gateway.get_share(self.r_share.id)
        self.assertEqual(r_share.id, self.r_share.id)
        self.assertEqual(r_share.shared_to.id, self.user.id)
        self.assertEqual(r_share.shared_by.id, self.sharer.id)
        self.assertRaises(errors.DoesNotExist,
                          self.user._gateway.get_share, wrong_share.id)