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