import npyscreen

from vent.menu import VentApp

npyscreen.TEST_SETTINGS['CONTINUE_AFTER_TEST_INPUT'] = False

def test_integration():
    """ Run integration tests """
    # close tutorial
    npyscreen.TEST_SETTINGS['TEST_INPUT'] = ['\n']

    # go to help
    npyscreen.TEST_SETTINGS['TEST_INPUT'] += ["^T"]

    # go through help menus
    npyscreen.TEST_SETTINGS['TEST_INPUT'] += ["^X", 'b', 'm', '\n', '\n']
    npyscreen.TEST_SETTINGS['TEST_INPUT'] += ["^X", 'b', 'p', '\n', '\n']
    npyscreen.TEST_SETTINGS['TEST_INPUT'] += ["^X", 'b', 't', '\n', '\n']
    npyscreen.TEST_SETTINGS['TEST_INPUT'] += ["^X", 'b', 'f', '\n', '\n']
    npyscreen.TEST_SETTINGS['TEST_INPUT'] += ["^X", 'b', 'c', '\n', '\n']
    npyscreen.TEST_SETTINGS['TEST_INPUT'] += ["^X", 'b', 's', '\n', '\n']
    npyscreen.TEST_SETTINGS['TEST_INPUT'] += ["^X", 'p', 'a', '\n', '\n']
    npyscreen.TEST_SETTINGS['TEST_INPUT'] += ["^X", 'p', 'b', '\n', '\n']

    # leave help menu
    npyscreen.TEST_SETTINGS['TEST_INPUT'] += ['\n']

    # run twice, once with tutorial, once without
    for x in xrange(2):
        A = VentApp()
        try:
            A.run(fork=False)
        except npyscreen.ExhaustedTestInput as e:
            pass
        else:
            raise npyscreen.ExhaustedTestInput

    # add a repo, build it, remove it
    # add a tool in a repo, build it, remove it
    # add a set of tools at a specific version in a repo, build them, and remove them

@@ -302,12 +302,14 @@
 += %5B
-%22%5ET%22
+'%5C014'
 %5D%0A%0A 
@@ -373,36 +373,38 @@
 EST_INPUT'%5D += %5B
-%22%5EX%22
+'%5C018'
 , 'b', 'm', '%5Cn'
@@ -449,36 +449,38 @@
 EST_INPUT'%5D += %5B
-%22%5EX%22
+'%5C018'
 , 'b', 'p', '%5Cn'
@@ -525,36 +525,38 @@
 EST_INPUT'%5D += %5B
-%22%5EX%22
+'%5C018'
 , 'b', 't', '%5Cn'
@@ -601,36 +601,38 @@
 EST_INPUT'%5D += %5B
-%22%5EX%22
+'%5C018'
 , 'b', 'f', '%5Cn'
@@ -677,36 +677,38 @@
 EST_INPUT'%5D += %5B
-%22%5EX%22
+'%5C018'
 , 'b', 'c', '%5Cn'
@@ -761,20 +761,22 @@
 T'%5D += %5B
-%22%5EX%22
+'%5C018'
 , 'b', '
@@ -829,36 +829,38 @@
 EST_INPUT'%5D += %5B
-%22%5EX%22
+'%5C018'
 , 'p', 'a', '%5Cn'
@@ -917,12 +917,14 @@
 += %5B
-%22%5EX%22
+'%5C018'
 , 'p

change ctrl codes