tdd with python and app engine
DESCRIPTION
An easy way to test your App Engine Python applicationsTRANSCRIPT
TDD with App Engine and Pythonthe easy way
Show of hands● Who already uses App Engine with Python?● Who does TDD with App Engine and
Python?● Who writes tests?
O que é o Google App Engine
O que é o Google App Engine
O que é o Google App Engine
What is Google App Engine● A PaaS - platform as a service● Specific APIs and libraries
o but can run Django, Flask etc adapted apps● You don't worry about the server● Google's team manages them for you● A local development environment● Deployment using the SDK (or git - for Java)
What else is in Google App Engine● Automagic spin-up and spin-down of servers● Pay-as-you-go● Datastore (NoSQL) + Google Cloud SQL● Queues - for asynchronous tasks● NDB - asynchronous data access (and
more)● Authentication● A framework that encourages good practices
o And punishes bad ones
More?● A management interface● You can keep multiple versions deployed
o And split traffic between them
● A brand-new management interfaceo Integrated with the other cloud products family
What we had before?● GAEUnit
o Deploys testing code to productiono Does it still work?
● SDK testbedo Batteries not included
● NoseGAE, pytest-gaeo Some batteries included
● ?
Why build another one?● Include more batteries● Being opinionated can be good
o Conventions over configuration helps newcomers● Some things are missing from the vanilla
SDKo Exampleso The way Django uses its fixtures is amazing
Why build another one? (continued)● Virtualenvs are cool
o To break the system Python is always painfulo Built-in Python may not be an option
● If it's hard to test, people won'to Laziness is one of the virtues of a programmer (even
if, in this case, it may not be)● A little bit of support goes a long way
What was done?● A skeleton project (on GitHub)● Creates a virtualenv● Runs sanity tests● Loads data from a JSON file● Assemble everything with a Makefile● Tests do not rely on the development server● You can run ipdb (in your tests)!
How do you use it?Demo1. git clone
o [email protected]:rbanffy/testable_appengine.git2. make venv3. nosetests (or py.test)
O que falta fazer● Importar hierarquias de objetos para testes● Tornar mais fácil usar em projetos já em
andamentoo Sobretudo manter o maquinário atualizadoo Se bem que isso pode nem ser importante
● Precisamos de mais usuárioso Que dêem mais palpites
Questions?
Contactabout.me/rbanffy@rbanffyhttps://github.com/rbanffy/testable_appengine