Ejemplo n.º 1
0
    def Run(self, args):
        if not args.host_port:
            args.host_port = arg_parsers.HostPort.Parse(
                datastore_util.GetHostPort(), ipv6_enabled=socket.has_ipv6)
        args.host_port.host = args.host_port.host or 'localhost'

        datastore_util.PrepareGCDDataDir(args)
        with datastore_util.StartGCDEmulator(args) as proc:
            datastore_util.WriteGCDEnvYaml(args)
            util.PrefixOutput(proc, 'datastore')
Ejemplo n.º 2
0
  def testWriteIPV6EnvYaml(self):
    env_mock = self.StartObjectPatch(util, 'WriteEnvYaml')

    args = type(str('args_mock'),
                (object,),
                dict(host_port=arg_parsers.HostPort('::', '8080'),
                     store_on_disk=True,
                     data_dir='temp_dir'))
    datastore_util.WriteGCDEnvYaml(args)
    env = {'DATASTORE_HOST': 'http://:::8080',
           'DATASTORE_EMULATOR_HOST': ':::8080',
           'DATASTORE_EMULATOR_HOST_PATH': ':::8080/datastore',
           'DATASTORE_DATASET': self.Project(),
           'DATASTORE_PROJECT_ID': self.Project(),}
    env_mock.assert_called_once_with(env, 'temp_dir')