diff --git a/mars-rover/test/test_rover.py b/mars-rover/test/test_rover.py index 58972db..4e3e9fb 100644 --- a/mars-rover/test/test_rover.py +++ b/mars-rover/test/test_rover.py @@ -1,26 +1,27 @@ from nose.tools import * import rover -def setup(): - global r - r = rover.Rover(10, 21, 'N') +class TestRover: -def test_initial_x(): - assert_equal(10, r.x) + def setup(self): + global r + r = rover.Rover(10, 21, 'N') -def test_initial_y(): - assert_equal(21, r.y) + def test_initial_x(self): + assert_equal(10, r.x) -def test_initial_orientation(): - assert_equal('N', r.orientation) + def test_initial_y(self): + assert_equal(21, r.y) -def test_move_f(): - r.move(list("f")) - assert_equal(22, r.y) - assert_equal(10, r.x) + def test_initial_orientation(self): + assert_equal('N', r.orientation) -@with_setup(setup) -def test_move_b(): - r.move(list("b")) - assert_equal(10, r.x) - assert_equal(20, r.y) + def test_move_f(self): + r.move(list("f")) + assert_equal(22, r.y) + assert_equal(10, r.x) + + def test_move_b(self): + r.move(list("b")) + assert_equal(10, r.x) + assert_equal(20, r.y)