Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

TDD with Python and App Engine


Published on

An easy way to test your App Engine Python applications

Published in: Internet, Technology, Business
  • Be the first to comment

TDD with Python and App Engine

  1. 1. TDD with App Engine and Python the easy way
  2. 2. Show of hands ● Who already uses App Engine with Python? ● Who does TDD with App Engine and Python? ● Who writes tests?
  3. 3. O que é o Google App Engine
  4. 4. O que é o Google App Engine
  5. 5. O que é o Google App Engine
  6. 6. 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)
  7. 7. 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
  8. 8. More? ● A management interface ● You can keep multiple versions deployed o And split traffic between them ● A brand-new management interface o Integrated with the other cloud products family
  9. 9. What we had before? ● GAEUnit o Deploys testing code to production o Does it still work? ● SDK testbed o Batteries not included ● NoseGAE, pytest-gae o Some batteries included ● ?
  10. 10. 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 SDK o Examples o The way Django uses its fixtures is amazing
  11. 11. Why build another one? (continued) ● Virtualenvs are cool o To break the system Python is always painful o Built-in Python may not be an option ● If it's hard to test, people won't o 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
  12. 12. 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)!
  13. 13. How do you use it? Demo 1. git clone o 2. make venv 3. nosetests (or py.test)
  14. 14. O que falta fazer ● Importar hierarquias de objetos para testes ● Tornar mais fácil usar em projetos já em andamento o Sobretudo manter o maquinário atualizado o Se bem que isso pode nem ser importante ● Precisamos de mais usuários o Que dêem mais palpites
  15. 15. Questions?
  16. 16. Contact @rbanffy