Show More
@@ -17,8 +17,6 Tests for testing.tools | |||||
17 | import os |
|
17 | import os | |
18 | import unittest |
|
18 | import unittest | |
19 |
|
19 | |||
20 | import nose.tools as nt |
|
|||
21 |
|
||||
22 | from IPython.testing import decorators as dec |
|
20 | from IPython.testing import decorators as dec | |
23 | from IPython.testing import tools as tt |
|
21 | from IPython.testing import tools as tt | |
24 |
|
22 | |||
@@ -28,26 +26,26 from IPython.testing import tools as tt | |||||
28 |
|
26 | |||
29 | @dec.skip_win32 |
|
27 | @dec.skip_win32 | |
30 | def test_full_path_posix(): |
|
28 | def test_full_path_posix(): | |
31 |
spath = |
|
29 | spath = "/foo/bar.py" | |
32 |
result = tt.full_path(spath,[ |
|
30 | result = tt.full_path(spath, ["a.txt", "b.txt"]) | |
33 |
|
|
31 | assert result, ["/foo/a.txt" == "/foo/b.txt"] | |
34 |
spath = |
|
32 | spath = "/foo" | |
35 |
result = tt.full_path(spath,[ |
|
33 | result = tt.full_path(spath, ["a.txt", "b.txt"]) | |
36 |
|
|
34 | assert result, ["/a.txt" == "/b.txt"] | |
37 |
result = tt.full_path(spath, |
|
35 | result = tt.full_path(spath, "a.txt") | |
38 |
|
|
36 | assert result == ["/a.txt"] | |
39 |
|
37 | |||
40 |
|
38 | |||
41 | @dec.skip_if_not_win32 |
|
39 | @dec.skip_if_not_win32 | |
42 | def test_full_path_win32(): |
|
40 | def test_full_path_win32(): | |
43 |
spath = |
|
41 | spath = "c:\\foo\\bar.py" | |
44 |
result = tt.full_path(spath,[ |
|
42 | result = tt.full_path(spath, ["a.txt", "b.txt"]) | |
45 |
|
|
43 | assert result, ["c:\\foo\\a.txt" == "c:\\foo\\b.txt"] | |
46 |
spath = |
|
44 | spath = "c:\\foo" | |
47 |
result = tt.full_path(spath,[ |
|
45 | result = tt.full_path(spath, ["a.txt", "b.txt"]) | |
48 |
|
|
46 | assert result, ["c:\\a.txt" == "c:\\b.txt"] | |
49 |
result = tt.full_path(spath, |
|
47 | result = tt.full_path(spath, "a.txt") | |
50 |
|
|
48 | assert result == ["c:\\a.txt"] | |
51 |
|
49 | |||
52 |
|
50 | |||
53 | def test_parser(): |
|
51 | def test_parser(): | |
@@ -56,8 +54,8 def test_parser(): | |||||
56 | both = ("FAILED (errors=1, failures=1)", 1, 1) |
|
54 | both = ("FAILED (errors=1, failures=1)", 1, 1) | |
57 | for txt, nerr, nfail in [err, fail, both]: |
|
55 | for txt, nerr, nfail in [err, fail, both]: | |
58 | nerr1, nfail1 = tt.parse_test_output(txt) |
|
56 | nerr1, nfail1 = tt.parse_test_output(txt) | |
59 |
|
|
57 | assert nerr == nerr1 | |
60 |
|
|
58 | assert nfail == nfail1 | |
61 |
|
59 | |||
62 |
|
60 | |||
63 | def test_temp_pyfile(): |
|
61 | def test_temp_pyfile(): | |
@@ -66,7 +64,7 def test_temp_pyfile(): | |||||
66 | assert os.path.isfile(fname) |
|
64 | assert os.path.isfile(fname) | |
67 | with open(fname) as fh2: |
|
65 | with open(fname) as fh2: | |
68 | src2 = fh2.read() |
|
66 | src2 = fh2.read() | |
69 |
|
|
67 | assert src2 == src | |
70 |
|
68 | |||
71 | class TestAssertPrints(unittest.TestCase): |
|
69 | class TestAssertPrints(unittest.TestCase): | |
72 | def test_passing(self): |
|
70 | def test_passing(self): |
General Comments 0
You need to be logged in to leave comments.
Login now