aboutsummaryrefslogtreecommitdiff
path: root/catapult/telemetry/telemetry/internal/util/path_unittest.py
blob: e9a0ee026328496a5888ced36bfa2356cc9e0ed1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

import os
import sys
import unittest

from telemetry import decorators
from telemetry.internal.util import path


class PathTest(unittest.TestCase):
  def testIsExecutable(self):
    self.assertFalse(path.IsExecutable('nonexistent_file'))
    self.assertTrue(path.IsExecutable(sys.executable))

  @decorators.Enabled('win')
  def testFindInstalledWindowsApplication(self):
    self.assertTrue(path.FindInstalledWindowsApplication(os.path.join(
        'Internet Explorer', 'iexplore.exe')))

  @decorators.Enabled('win')
  def testFindInstalledWindowsApplicationWithWildcards(self):
    self.assertTrue(path.FindInstalledWindowsApplication(os.path.join(
        '*', 'iexplore.exe')))