예제 #1
0
    def test_run(self):
        """Test run."""
        self.stdout = [
            'aaaa\n', 'bbbb\n',
            ('Path: /var/folders/bg/tn9j_qb532s4fz11rzz7m6sc0000gm/0'
             '//com.apple.LaunchServices-134500.csstore\n'), 'cccc\n', ''
        ]
        mac.run()

        self.mock.exists.return_value = True
        self.mock.rmtree.assert_has_calls([
            mock.call('/var/folders/bg/tn9j_qb532s4fz11rzz7m6sc0000gm/0',
                      ignore_errors=True),
            mock.call('/var/folders/bg/tn9j_qb532s4fz11rzz7m6sc0000gm/T',
                      ignore_errors=True)
        ])
예제 #2
0
def run_platform_init_scripts():
  """Run platform specific initialization scripts."""
  logs.log('Running platform initialization scripts.')

  plt = environment.platform()
  if plt == 'ANDROID':
    android_init.run()
  elif plt == 'CHROMEOS':
    chromeos_init.run()
  elif plt == 'FUCHSIA':
    fuchsia_init.run()
  elif plt == 'LINUX':
    linux_init.run()
  elif plt == 'MAC':
    mac_init.run()
  elif plt == 'WINDOWS':
    windows_init.run()
  else:
    raise RuntimeError('Unsupported platform')

  logs.log('Completed running platform initialization scripts.')
예제 #3
0
def run_platform_init_scripts():
  """Run platform specific initialization scripts."""
  logs.log('Running platform initialization scripts.')

  plt = environment.platform()
  if environment.is_android_emulator():
    # Nothing to do here since emulator is not started yet.
    pass
  elif environment.is_android():
    android_init.run()
  elif plt == 'CHROMEOS':
    chromeos_init.run()
  elif plt == 'FUCHSIA':
    fuchsia_init.run()
  elif plt == 'LINUX':
    linux_init.run()
  elif plt == 'MAC':
    mac_init.run()
  elif plt == 'WINDOWS':
    windows_init.run()
  else:
    raise RuntimeError('Unsupported platform')

  logs.log('Completed running platform initialization scripts.')