Ejemplo n.º 1
0
def setUpModule():
    if EMULATOR_DATASET is None:
        client.DATASET = TESTS_DATASET
        Config.CLIENT = datastore.Client()
    else:
        Config.CLIENT = datastore.Client(dataset_id=EMULATOR_DATASET)
        populate_datastore.add_characters(client=Config.CLIENT)
Ejemplo n.º 2
0
def setUpModule():
    if EMULATOR_DATASET is None:
        client.DATASET = TESTS_DATASET
        Config.CLIENT = datastore.Client()
    else:
        Config.CLIENT = datastore.Client(dataset_id=EMULATOR_DATASET)
        populate_datastore.add_characters(client=Config.CLIENT)
Ejemplo n.º 3
0
    def setUpClass(cls):
        cls.CLIENT = clone_client(Config.CLIENT)
        # Remove the namespace from the cloned client, since these
        # query tests rely on the entities to be already stored and indexed,
        # hence ``TEST_NAMESPACE`` set at runtime can't be used.
        cls.CLIENT.namespace = None

        # In the emulator, re-populating the datastore is cheap.
        if EMULATOR_DATASET is not None:
            # Populate the datastore with the cloned client.
            populate_datastore.add_characters(client=cls.CLIENT)

        cls.CHARACTERS = populate_datastore.CHARACTERS
        # Use the client for this test instead of the global.
        cls.ANCESTOR_KEY = cls.CLIENT.key(*populate_datastore.ANCESTOR)
Ejemplo n.º 4
0
    def setUpClass(cls):
        cls.CLIENT = clone_client(Config.CLIENT)
        # Remove the namespace from the cloned client, since these
        # query tests rely on the entities to be already stored and indexed,
        # hence ``test_namespace`` set at runtime can't be used.
        cls.CLIENT.namespace = None

        # In the emulator, re-populating the datastore is cheap.
        if os.getenv(GCD_DATASET) is not None:
            # Populate the datastore with the cloned client.
            populate_datastore.add_characters(client=cls.CLIENT)

        cls.CHARACTERS = populate_datastore.CHARACTERS
        # Use the client for this test instead of the global.
        cls.ANCESTOR_KEY = cls.CLIENT.key(*populate_datastore.ANCESTOR)