Konstantine Rybnikov avatar Konstantine Rybnikov committed 5436767

add regular-python-engineer doc

Comments (0)

Files changed (1)

source/en_posts/2012-07-12-regular-python-engineer.rst

+================================
+ Regular Python Engineer Skills
+================================
+
+This document aims to cover different gaps that regular engineer might
+have, and ways to improve them in most common aspects. This document
+is incomplete and should be updated with missing common needs for
+regular python engineer.
+
+Most of topics should cover lots of practical impact of typical python
+engineer's tasks (also some topics assume web and can be skipped if
+it’s not).
+
+Testing
+=======
+
+Literature, libraries and software
+----------------------------------
+
+- `Testing topic on Django docs
+  <https://docs.djangoproject.com/en/dev/topics/testing/>`_
+- `Mock library <http://mock.readthedocs.org/en/latest/index.html>`_
+- `Testinc topic in Flask docs
+  <http://flask.pocoo.org/docs/testing/>`_
+- `Selenium Simple Test <http://testutils.org/sst/>`_
+
+Questions
+---------
+
+- What is functional/integrational/unit-testing? Describe the
+  difference, needs and common problems.
+- What are mocks? What’s they’re purpose? How do you use them?
+
+Extra-points
+------------
+
+Imagine you have function create_consumer from module
+``proj.consumer.bl`` that looks like this:
+
+.. code-block:: python
+
+    # module proj/consumer/bl.py
+
+    from proj.consumer.model import Consumer
+    from proj.email.consumer import send_welcome_email
+    from proj.company.bl import add_company_employee
+
+    def create_consumer(email, password, company=None):
+        consumer = Consumer(email, password)
+        if company is not None:
+            add_company_employee(company, consumer)
+
+        send_welcome_email(consumer)
+
+Write such unit-tests for this function that make sure:
+
+- consumer gets created
+- ``add_company_employee`` gets called when company is not ``None``
+- ``send_welcome_email`` gets called with consumer as parameter
+
+Clean Hypermedia API Design
+===========================
+
+Literature, libraries and software
+----------------------------------
+
+- `Nobody Understands REST or HTTP
+  <http://blog.steveklabnik.com/posts/2011-07-03-nobody-understands-rest-or-http>`_
+- `Some People Understand REST and HTTP
+  <http://blog.steveklabnik.com/posts/2011-08-07-some-people-understand-rest-and-http>`_
+- `Classification of HTTP-based APIs
+  <http://nordsc.com/ext/classification_of_http_based_apis.html>`_
+- `http-headers-status.png
+  <http://viswaug.files.wordpress.com/2008/11/http-headers-status1.png>`_
+
+Questions
+---------
+
+- Describe main REST principles and restrictions.
+- How would you implement flight ticket-ordering API?
+- Why would it be bad to implement API via ``POST
+  /order_ticket/from/Kiev/to/London``?
+
+Extra-points
+------------
+
+You need to design API for your bookmarks list. Each of your bookmarks
+has these fields:
+
+* id
+* title
+* url
+* tags
+* importance
+* date_created
+* date_modified
+
+Show how to list bookmarks, edit field of concrete bookmark, how to
+list bookmarks filtered by some tags.
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.