Show More
@@ -0,0 +1,48 b'' | |||
|
1 | #!/usr/bin/env python | |
|
2 | # encoding: utf-8 | |
|
3 | """ | |
|
4 | Tests for platutils.py | |
|
5 | """ | |
|
6 | ||
|
7 | #----------------------------------------------------------------------------- | |
|
8 | # Copyright (C) 2008-2009 The IPython Development Team | |
|
9 | # | |
|
10 | # Distributed under the terms of the BSD License. The full license is in | |
|
11 | # the file COPYING, distributed as part of this software. | |
|
12 | #----------------------------------------------------------------------------- | |
|
13 | ||
|
14 | #----------------------------------------------------------------------------- | |
|
15 | # Imports | |
|
16 | #----------------------------------------------------------------------------- | |
|
17 | ||
|
18 | import os | |
|
19 | import sys | |
|
20 | ||
|
21 | import nose.tools as nt | |
|
22 | ||
|
23 | from IPython.platutils import find_cmd, FindCmdError | |
|
24 | from IPython.testing import decorators as dec | |
|
25 | ||
|
26 | #----------------------------------------------------------------------------- | |
|
27 | # Tests | |
|
28 | #----------------------------------------------------------------------------- | |
|
29 | ||
|
30 | def test_find_cmd_python(): | |
|
31 | """Make sure we find sys.exectable for python.""" | |
|
32 | nt.assert_equals(find_cmd('python'), sys.executable) | |
|
33 | ||
|
34 | @dec.skip_win32 | |
|
35 | def test_find_cmd(): | |
|
36 | """Make sure we can find the full path to ls.""" | |
|
37 | path = find_cmd('ls') | |
|
38 | nt.assert_true(path.endswith('ls')) | |
|
39 | ||
|
40 | @dec.skip_if_not_win32 | |
|
41 | def test_find_cmd(): | |
|
42 | """Try to find pythonw on Windows.""" | |
|
43 | path = find_cmd('pythonw') | |
|
44 | nt.assert_true(path.endswith('pythonw.exe')) | |
|
45 | ||
|
46 | def test_find_cmd_fail(): | |
|
47 | """Make sure that FindCmdError is raised if we can't find the cmd.""" | |
|
48 | nt.assert_raises(FindCmdError,find_cmd,'asdfasdf') |
General Comments 0
You need to be logged in to leave comments.
Login now