File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ {
2+ "metadata" : {
3+ "name" : " "
4+ },
5+ "nbformat" : 3 ,
6+ "nbformat_minor" : 0 ,
7+ "worksheets" : [
8+ {
9+ "cells" : [
10+ {
11+ "cell_type" : " code" ,
12+ "collapsed" : false ,
13+ "input" : [
14+ " from math import sqrt"
15+ ],
16+ "language" : " python" ,
17+ "metadata" : {},
18+ "outputs" : []
19+ },
20+ {
21+ "cell_type" : " heading" ,
22+ "level" : 2 ,
23+ "metadata" : {},
24+ "source" : [
25+ " Unittest"
26+ ]
27+ },
28+ {
29+ "cell_type" : " code" ,
30+ "collapsed" : false ,
31+ "input" : [
32+ " from unittest import TestCase\n " ,
33+ " \n " ,
34+ " class SqrtTestCase(TestCase):\n " ,
35+ " def test_sqrt(self):\n " ,
36+ " self.assertEqual(sqrt(36), 6)"
37+ ],
38+ "language" : " python" ,
39+ "metadata" : {},
40+ "outputs" : []
41+ },
42+ {
43+ "cell_type" : " heading" ,
44+ "level" : 2 ,
45+ "metadata" : {},
46+ "source" : [
47+ " Nose"
48+ ]
49+ },
50+ {
51+ "cell_type" : " code" ,
52+ "collapsed" : false ,
53+ "input" : [
54+ " import nose.tools as nt\n " ,
55+ " \n " ,
56+ " def test_sqrt():\n " ,
57+ " nt.assert_equal(sqrt(36), 6)"
58+ ],
59+ "language" : " python" ,
60+ "metadata" : {},
61+ "outputs" : []
62+ },
63+ {
64+ "cell_type" : " heading" ,
65+ "level" : 2 ,
66+ "metadata" : {},
67+ "source" : [
68+ " py.test"
69+ ]
70+ },
71+ {
72+ "cell_type" : " code" ,
73+ "collapsed" : false ,
74+ "input" : [
75+ " def test_sqrt():\n " ,
76+ " assert sqrt(36) == 6"
77+ ],
78+ "language" : " python" ,
79+ "metadata" : {},
80+ "outputs" : []
81+ }
82+ ],
83+ "metadata" : {}
84+ }
85+ ]
86+ }
You can’t perform that action at this time.
0 commit comments