Show More
@@ -1,26 +1,28 b'' | |||
|
1 | 1 | import os |
|
2 | 2 | import errno |
|
3 | 3 | import os.path |
|
4 | 4 | import subprocess |
|
5 | 5 | import nose.tools as nt |
|
6 | 6 | |
|
7 | 7 | test_rst_fname = os.path.join('tests', 'tutorial.rst.ref') |
|
8 | 8 | ref_ipynb_fname = os.path.join('tests', 'tutorial.ipynb.ref') |
|
9 | 9 | test_generate_ipynb_fname = os.path.join('tests', 'tutorial.ipynb') |
|
10 | 10 | |
|
11 | 11 | |
|
12 | 12 | def clean_dir(): |
|
13 | 13 | "Remove generated ipynb file created during conversion" |
|
14 | 14 | try: |
|
15 | 15 | os.unlink(test_generate_ipynb_fname) |
|
16 | 16 | except OSError, e: |
|
17 | 17 | if e.errno != errno.ENOENT: |
|
18 | 18 | raise |
|
19 | 19 | |
|
20 | 20 | |
|
21 | 21 | @nt.with_setup(clean_dir, clean_dir) |
|
22 | 22 | def test_command_line(): |
|
23 | 23 | with open(ref_ipynb_fname, 'rb') as f: |
|
24 | 24 | ref_output = f.read() |
|
25 |
|
|
|
25 | proc = subprocess.Popen(['./rst2ipynb.py', test_rst_fname], | |
|
26 | stdout=subprocess.PIPE) | |
|
27 | output = proc.communicate()[0] | |
|
26 | 28 | nt.assert_equal(ref_output, output) |
General Comments 0
You need to be logged in to leave comments.
Login now