Skip to content

nbrl/lang-exercise-python

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

lang-exercise-python

Testing a simple Redis messaging server with Python

Setup

We need a few packages installed globally for testing.

sudo pip install coverage nose

Then we need to set up the environment ready to run.

virtualenv env
source ./env/bin/activate
pip install -r requirements.txt

To exit the virtualenv use deactivate

Running the app

To use Redis needs to be running (as yet no error checking if the app is started without redis):

# Install package for redis server (e.g. brew install redis)
redis-server

Simply:

python langapp.py

To send a new message:

curl http://127.0.0.1:8888/in/ -d 'your message'

To query a message by id:

curl http://127.0.0.1:8888/messages/<int:id>/

Testing the app

To run all the tests:

nosetests -sv

Saving new dependencies

If the dependencies for the project change, update the requirements.

pip freeze > requirements.txt

About

Testing a simple Redis messaging server with Python

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages