def test_subscriber_unsubscribing(self):

        # create collection
        first_collection_name = "shareable_collection"
        file = open("../test_resources/XooML.xml")
        StorageServer.add_collection(
            user_id=self.__account_id, collection_name=first_collection_name, callback=self.stop, file=file
        )
        response = self.wait()
        self.assertEqual(StorageResponse.OK, response)

        # create sharing record
        SharingController.create_sharing_record(self.__account_id, first_collection_name, callback=self.stop)
        sharing_secret = self.wait()
        self.assertTrue(sharing_secret is not None)

        # subscribe
        SharingController.subscribe_to_sharing_space(self.__subscriber_id, sharing_secret, callback=self.stop)
        subscribers_collection_name = self.wait()
        self.assertTrue(subscribers_collection_name is not None)

        # unsubscribe
        SharingController.unsubscribe_from_sharing_space(
            self.__subscriber_id, subscribers_collection_name, callback=self.stop
        )
        response = self.wait()
        self.assertEqual(StorageResponse.OK, response)

        # verify unsubscribe
        SharingController.get_sharing_record_by_secret(sharing_secret, callback=self.stop)
        sharing_record = self.wait()
        subscribers_list = sharing_record.get_subscribers()
        self.assertTrue(self.__subscriber_id not in subscribers_list)

        SharingController.get_sharing_record_from_subscriber_info(
            self.__subscriber_id, subscribers_collection_name, callback=self.stop
        )
        sharing_record = self.wait()
        self.assertTrue(sharing_record is None)

        # cleanup
        SharingController.remove_sharing_record_by_secret(sharing_secret, callback=self.stop)
        self.wait()
        StorageServer.remove_collection(self.__account_id, first_collection_name, callback=self.stop)
        self.wait()
        StorageServer.remove_collection(self.__subscriber_id, subscribers_collection_name, callback=self.stop)