Exemple #1
0
 def test_delay_default(self):
     s = Session(self.session_name, enable_auto_advance=True)
     s.teletype("echo 'this is the default delay'")
     s.send_keys('Enter', literal=False)
Exemple #2
0
from lib import helpers, settings
from oraide import Session, keys

# stary clean
helpers.reset()

s = Session('demo')
with s.auto_advance():
    s.enter('cd')
    s.enter('mkdir {}'.format(settings.DEMO_PATH))
    s.enter('cd {}'.format(settings.DEMO_PATH))

with s.auto_advance():
    s.enter('vim Dockerfile')
    s.teletype('i')
    s.enter('FROM debian:jessie')
    s.enter('RUN apt-get update')
    s.enter('RUN apt-get install -y cowsay', after=keys.escape)
s.enter(':x')

s.enter('docker build -t cowsay .')
s.enter('docker run cowsay')
s.enter('docker run cowsay /usr/games/cowsay')
s.enter('docker run cowsay /usr/games/cowsay "hola mundo"')

with s.auto_advance():
    s.enter('vim Dockerfile')
    s.teletype('jjo')
    s.enter('CMD ["/usr/games/cowsay"]', after=keys.escape)
s.enter(':x')
Exemple #3
0
 def test_delay_set_by_session_attribute(self):
     s = Session(self.session_name,
                 enable_auto_advance=True,
                 teletype_delay=10)
     s.teletype("echo 'this is the delay set on the session at-large'")
     s.send_keys('Enter', literal=False)
Exemple #4
0
 def test_delay_set_by_argument(self):
     s = Session(self.session_name, enable_auto_advance=True)
     s.teletype("echo 'this is the delay set on the method'", delay=10)
     s.send_keys('Enter', literal=False)
Exemple #5
0
 def test_delay_default(self):
     s = Session(self.session_name, enable_auto_advance=True)
     s.teletype("echo 'this is the default delay'")
     s.send_keys('Enter', literal=False)
Exemple #6
0
 def test_delay_set_by_session_attribute(self):
     s = Session(self.session_name, enable_auto_advance=True,
                 teletype_delay=10)
     s.teletype("echo 'this is the delay set on the session at-large'")
     s.send_keys('Enter', literal=False)
Exemple #7
0
 def test_delay_set_by_argument(self):
     s = Session(self.session_name, enable_auto_advance=True)
     s.teletype("echo 'this is the delay set on the method'", delay=10)
     s.send_keys('Enter', literal=False)