restfulie-py: changes in the procedure for running tests (and a little more)

4 views
Skip to first unread message

Pedro Matiello

unread,
Feb 23, 2011, 7:45:49 PM2/23/11
to restfu...@googlegroups.com
Folks, gone are the days of running the tests with python setup.py nosetests. In this age, we turn ourselves back to the traditional, tried-and-proven procedures. In this age, we execute our tests by running make test.

I've added a couple of integration tests that actually hit an HTTP server, get a response, and make assertions on it. In order to make them runnable and passable without previous setup or an internet connection, I've added a ridiculously simple HTTP server that can be used for tests like these. For the server must, of course, be running during the execution of the tests, it should be started before the execution starts and stopped when it's finished. But have no fear: the test rule on the Makefile will take care of everything for you.


Pedro

Guilherme Silveira

unread,
Feb 23, 2011, 7:56:43 PM2/23/11
to restfu...@googlegroups.com, Pedro Matiello
Nice... congrats
Docs on the wiki++ for the build?

And what about that nice async commit?

Regards

Guilherme Silveira
Caelum | Ensino e Inovação
http://www.caelum.com.br/

d.ca...@gmail.com

unread,
Feb 23, 2011, 8:00:52 PM2/23/11
to restfu...@googlegroups.com
Pedro, please take a look at mine restuflie-py's branch [1]. I made more simple integration tests. But I used Flask as a fake web server, and I start and stop it via a Python code. So I take an advantage of the setUp and tearDown hooks of the tests. What do you think?

In addition, I want to suggest should-dsl [2] and specloud [3] to make our tests more self explainable. They're very good tools for working with tests.


2011/2/23 Pedro Matiello <pmat...@gmail.com>

Folks, gone are the days of running the tests with python setup.py nosetests. In this age, we turn ourselves back to the traditional, tried-and-proven procedures. In this age, we execute our tests by running make test.

I've added a couple of integration tests that actually hit an HTTP server, get a response, and make assertions on it. In order to make them runnable and passable without previous setup or an internet connection, I've added a ridiculously simple HTTP server that can be used for tests like these. For the server must, of course, be running during the execution of the tests, it should be started before the execution starts and stopped when it's finished. But have no fear: the test rule on the Makefile will take care of everything for you.


Pedro



--
Douglas Camata
Graduando em Ciência da Computação (UENF)

Skype: douglas_camata
-----------------------------------
Linux User #509211

Pedro Matiello

unread,
Feb 23, 2011, 8:08:40 PM2/23/11
to restfu...@googlegroups.com
Callback support is already merged. I'll try to implement the parallel loading idea (i.e. asynchronous, but without callbacks) this week with Atoji and/or Toshi.

Also, the instructions for bootstrapping the project and running the tests were already updated in the Readme.

Pedro Matiello

unread,
Feb 23, 2011, 8:24:15 PM2/23/11
to restfu...@googlegroups.com
I'd like to avoid an extra dependency on Flask as long as the simple HTTP server proves itself sufficient.

I'll take a look at should-dsl and specloud. They seem to be interesting. Thanks for the suggestions.

Alexandre Atoji

unread,
Feb 23, 2011, 8:36:16 PM2/23/11
to restfu...@googlegroups.com, Pedro Matiello
I agree with Matiello. I don't like add too many dependencies. Restfulie code is beautiful small =)

On Wed, Feb 23, 2011 at 10:24 PM, Pedro Matiello <pmat...@gmail.com> wrote:
I'd like to avoid an extra dependency on Flask as long as the simple HTTP server proves itself sufficient.

I'll take a look at should-dsl and specloud. They seem to be interesting. Thanks for the suggestions.



--
Alexandre Atoji





Guilherme Silveira

unread,
Feb 23, 2011, 8:44:25 PM2/23/11
to restfu...@googlegroups.com
> Callback support is already merged.
Docs included? :)

Guilherme Silveira
Caelum | Ensino e Inovação
http://www.caelum.com.br/

Pedro Matiello

unread,
Feb 23, 2011, 8:58:49 PM2/23/11
to restfu...@googlegroups.com
I'm working on it. :)

Ok, not really working on it now as I'm refactoring the tests. But I'll target the lack of documentation next.

d.ca...@gmail.com

unread,
Feb 23, 2011, 9:14:56 PM2/23/11
to restfu...@googlegroups.com
I did some improvements to the Makefile. The "all" target install everything normally and the "dev" one does like the first, but using "setup.py develop". Also fixed a little bug in the bins. Updated the textile too.

May I push it?

2011/2/23 Pedro Matiello <pmat...@gmail.com>

I'm working on it. :)

Ok, not really working on it now as I'm refactoring the tests. But I'll target the lack of documentation next.

Pedro Matiello

unread,
Feb 23, 2011, 9:17:21 PM2/23/11
to restfu...@googlegroups.com
Push it. Thanks!

d.ca...@gmail.com

unread,
Feb 23, 2011, 9:32:48 PM2/23/11
to restfu...@googlegroups.com
I'm sorry about my insecurity to commit and push to the repo by myself. I'm afraid of doing something wrong, because I think I'm the only person developing restuflie-py that isn't inside Caelum.

Thanks!

2011/2/23 Pedro Matiello <pmat...@gmail.com>
Push it. Thanks!

Pedro Matiello

unread,
Feb 23, 2011, 10:54:04 PM2/23/11
to restfu...@googlegroups.com
Don't worry. This list is here so we all can synchronize. :)

Guilherme Silveira

unread,
Feb 24, 2011, 9:04:00 AM2/24/11
to restfu...@googlegroups.com, Pedro Matiello
Don't worry Douglas... if you feel its a big change and you want
feedback, like Matiello wanted in his last feature, push to branch and
ask feedback.
Otherwise go for master. The faster, the better.
And we always play the game: "enhance any code that you can", so if
you see any code you want to change an if for enhanced legibility,
feel free. It is not because it was not you who wrote the "if" that
you cant refactor it. And the same will apply to any part of code (and
any restfulie version).

Regards

Guilherme Silveira
Caelum | Ensino e Inovação
http://www.caelum.com.br/

Guilherme Silveira

unread,
Feb 24, 2011, 9:05:57 AM2/24/11
to restfu...@googlegroups.com, Pedro Matiello
ps: just like I did with Pedro's implementation:
https://github.com/caelum/restfulie-py/issues/1#comment_804032

Althought it wasnt the way I expected, in the end the + were better
than the -... so, let it be the way Pedro implemented it!

Regards

Guilherme Silveira
Caelum | Ensino e Inovação
http://www.caelum.com.br/

Bruno Oliveira

unread,
Feb 24, 2011, 9:13:57 AM2/24/11
to restfu...@googlegroups.com
Don't worry Douglas, restfulie is for a multiplayer game for all :D.
I'm learning a lot.

Go ahead!

--
“Success is having to worry about every damn thing in the world,
except money.” - Johnny Cash
-
http://abstractj.com
http://github.com/abstractj
-
Volenti Nihil Difficile

Reply all
Reply to author
Forward
0 new messages