Skip to content

Instantly share code, notes, and snippets.

@bukzor
Last active December 10, 2015 22:48
Show Gist options
  • Save bukzor/4504742 to your computer and use it in GitHub Desktop.
Save bukzor/4504742 to your computer and use it in GitHub Desktop.
Try to assert that the pudb ctrl+p interaction works as intended.
#!/usr/bin/env python
"pudb test script"
def main():
"The entry point"
from pudb.debugger import Debugger
import urwid.html_fragment
dbg = Debugger()
screen = urwid.html_fragment.HtmlGenerator()
screen.sizes = [ (80, 24) ] *2
screen.keys = [ ("ctrl p",) ]
dbg.ui.screen = screen
dbg.ui.setup_palette(screen)
try:
dbg._runscript('trivial.py')
except urwid.main_loop.ExitMainLoop:
pass
# Show the equivalent html.
#print '\n'.join(screen.fragments)
assert dbg.ui.preferences.shown == True
main()
@asmeurer
Copy link

I'm assuming the contents of trivial.py don't matter here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment