Skip to content

Commit 96eefee

Browse files
committed
Test loading R notebook (should fail)
1 parent c0e408d commit 96eefee

File tree

4 files changed

+50
-0
lines changed

4 files changed

+50
-0
lines changed

tests/bogus_ipynb.ipynb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# This is not a real ipynb file!
2+
# THIS IS BOGUS BWAHAHA

tests/r_notebook.ipynb

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
{
2+
"cells": [
3+
{
4+
"cell_type": "code",
5+
"execution_count": 1,
6+
"metadata": {
7+
"collapsed": false
8+
},
9+
"outputs": [
10+
{
11+
"name": "stdout",
12+
"output_type": "stream",
13+
"text": [
14+
"[1] \"Hello world\"\n"
15+
]
16+
}
17+
],
18+
"source": [
19+
"print(\"Hello world\")"
20+
]
21+
}
22+
],
23+
"metadata": {
24+
"kernelspec": {
25+
"display_name": "R",
26+
"language": "R",
27+
"name": "ir"
28+
},
29+
"language_info": {
30+
"codemirror_mode": "r",
31+
"file_extension": ".r",
32+
"mimetype": "text/x-r-source",
33+
"name": "R",
34+
"pygments_lexer": "r",
35+
"version": "3.3.2"
36+
}
37+
},
38+
"nbformat": 4,
39+
"nbformat_minor": 0
40+
}

tests/test_defs.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,3 +41,7 @@ def test_all(init):
4141
def test_bogus_ipynb():
4242
with pytest.raises(ImportError):
4343
import ipynb.fs.defs.bogus_ipynb as bogus_ipynb
44+
45+
def test_r_notebook_ipynb():
46+
with pytest.raises(ImportError):
47+
import ipynb.fs.defs.r_notebook

tests/test_full.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,3 +37,7 @@ def test_all(init):
3737
def test_bogus_ipynb():
3838
with pytest.raises(ImportError):
3939
import ipynb.fs.full.bogus_ipynb as bogus_ipynb
40+
41+
def test_r_notebook_ipynb():
42+
with pytest.raises(ImportError):
43+
import ipynb.fs.full.r_notebook

0 commit comments

Comments
 (0)