PageRenderTime 39ms CodeModel.GetById 14ms RepoModel.GetById 0ms app.codeStats 0ms

/debug.py

https://bitbucket.org/johndistasio/links-python
Python | 24 lines | 15 code | 2 blank | 7 comment | 0 complexity | 19928f6ad3d1752338f8a3978ba13a41 MD5 | raw file
  1. """
  2. Debug methods for use during testing.
  3. """
  4. import json
  5. def return_link():
  6. link = '{ "link_id": 1, "user_link_id": 1, "url": "http://www.google.com", "tags": [ "search", "google", "favorites" ] }'
  7. return link
  8. def return_links_p():
  9. """
  10. Returns links as a python object:
  11. {
  12. "links" :
  13. [
  14. { link item },
  15. { link item }
  16. ]
  17. }
  18. """
  19. raw_links = '{ "links" : [ { "link_id": 1, "user_link_id": 1, "url": "http://www.google.com", "tags": [ "search", "google", "favorites" ] }, { "link_id": 2, "user_link_id": 2, "url": "http://www.jobtarget.com", "tags": [ "work", "job boards", "oneclick", "job distribution" ] }, { "link_id": 3, "user_link_id": 3, "url": "http://www.stackoverflow.com", "tags": [ "technology", "forum", "favorites" ] }, { "link_id": 4, "user_link_id": 4, "url": "http://www.punchfork.com", "tags": [ "cooking", "recipies" ] }, { "link_id": 5, "user_link_id": 5, "url": "http://www.duckduckgo.com", "tags": [ "search" ] }, { "link_id": 6, "user_link_id": 6, "url": "http://www.amazon.com", "tags": [ "shopping", "online shopping" ] }, { "link_id": 7, "user_link_id": 7, "url": "http://www.python.org", "tags": [ "python", "development", "weirdness" ] }, { "link_id": 8, "user_link_id": 8, "url": "http://www.gmail.com", "tags": [ "google", "email" ] }, { "link_id": 9, "user_link_id": 9, "url": "http://www.tacobell.com", "tags": [ "fast food", "tacos" ] }, { "link_id": 10, "user_link_id": 10, "url": "http://www.bbc.co.uk", "tags": [ "news", "international news", "bbc" ] }, { "link_id": 11, "user_link_id": 11, "url": "http://docs.oracle.com/javase/6/docs/api/", "tags": [ "java", "development", "documentation" ] }, { "link_id": 12, "user_link_id": 12, "url": "http://www.bitbucket.org", "tags": [ "source code", "mercurial" ] }, { "link_id": 13, "user_link_id": 13, "url": "http://www.linode.com", "tags": [ "hosting", "VPS", "linux", "favorites" ] }, { "link_id": 14, "user_link_id": 14, "url": "http://www.ci.new-london.ct.us/", "tags": [ "new london", "crappy websites" ] }, { "link_id": 15, "user_link_id": 15, "url": "http://www.scala-lang.org/api/current/index.html", "tags": [ "scala", "documentation", "development", "api" ] }, { "link_id": 16, "user_link_id": 16, "url": "http://awesome.naquadah.org/", "tags": [ "awesome", "awesomewm", "window manager", "tiling window manager", "linux" ] } ] }'
  20. links = json.loads(raw_links)
  21. return links