def test_make_share(self):
        """Test make_share."""
        sharer = self.factory.make_user(username='sharer')
        vgw = ReadWriteVolumeGateway(self.user)
        a_dir = vgw.make_subdirectory(vgw.get_root().id, 'the dir')
        a_file = vgw.make_file(vgw.get_root().id, 'the file')
        # test some obvious error conditions
        # can't share files
        self.assertRaises(
            errors.NotADirectory, vgw.make_share, a_file.id, 'hi',
            user_id=sharer.id)
        # user doesn't exist
        self.assertRaises(
            errors.DoesNotExist, vgw.make_share, a_dir.id, 'hi',
            user_id=sharer.id + 1)
        share = vgw.make_share(a_dir.id, 'hi', user_id=sharer.id)
        self.assertEqual(share.root_id, a_dir.id)
        self.assertEqual(share.accepted, False)
        self.assertEqual(share.shared_to_id, sharer.id)
        self.assertNotEqual(share.when_shared, None)
        self.assertNotEqual(share.when_last_changed, None)