Permalink
Browse files

Added some test files

  • Loading branch information...
1 parent 6e3db4b commit f9942b79f20c70b5e329f8339209cca13ce98444 @mbrochh committed Jun 5, 2012
Showing with 88 additions and 0 deletions.
  1. 0 foobar.py → __init__.py
  2. +49 −0 demo.py
  3. +5 −0 test.py
  4. +34 −0 utils.py
File renamed without changes.
View
49 demo.py
@@ -0,0 +1,49 @@
+"""Module for testing some python-mode features."""
+import os
+
+from utils import set_breakpoint
+# from utils import does_not_exist
+
+
+def main(*args, **kwargs):
+ """See? We got nice syntax highting."""
+ print 'Hello world'
+ set_breakpoint(42, 42, data={'key': 'value', })
+
+def fold_this():
+ """We can fold code blocks by pressing ``f``."""
+ print 'Fold it.'
+
+
+def fold_all():
+ """We can fold everything by pressing ``F``."""
+ print 'Fold all.'
+
+
+def create_ropeproject():
+ """We would create a ropeproject by executing ``:RopeOpenProject``."""
+ print 'Now add your venv to ``.ropeproject/config.py``!'
+
+
+def life_syntax_checking():
+ """Pylint checks our code on each save."""
+ # Try to uncomment this and save.
+ # Try to uncomment the os import and save.
+ # Try to uncomment the does_not_exist imort and save.
+ # abc = 5
+
+
+def code_completion():
+ """Code completion makes life easy."""
+ # Try to call one of our methods here.
+ # Try to import something from utils
+
+
+def open_utils_py():
+ """We can use Ctlp to open files in our project."""
+ print 'Open ``utils.py`` in a new vertical split via ``<C-p>ut<C-v>``'
+ print 'Now open ``utils.py`` in a new tab via ``<C-p>ut<C-t>``.'
+
+
+if __name__ == '__main__':
+ main()
View
@@ -0,0 +1,5 @@
+import os
+
+
+
+
View
@@ -0,0 +1,34 @@
+"""Another file in our package."""
+from urlparse import urljoin
+
+
+def print_twitter_url():
+ """We can lookup the urljoin method via ``<Leader>g``."""
+ print urljoin('http://www.twitter.com', 'mbrochh')
+
+
+def try_to_import_from_demo_py():
+ """Code completion makes importing easy!"""
+ print 'Try to import that method which starts with ``open_``.'
+
+
+def set_breakpoint(arg1, arg2, data=None):
+ """We can set breakpoints via ``<Leader>b``."""
+ foo = 'bar'
+ result = arg1 + arg2
+ import ipdb; ipdb.set_trace() # BREAKPOINT
+ print 'Try to set a breakpoint before this statement.'
+ print 'Then run ``python demo.py``.'
+ import ipdb; ipdb.set_trace() # BREAKPOINT
+ print 'Good bye!'
+ # ?
+ # help a
+ # a
+ # l
+ # next
+ # inspect data
+ # bt
+ # u
+ # s
+ # c
+ # exit

0 comments on commit f9942b7

Please sign in to comment.