def test_literal_keys_appear_in_session(self): self.start_tmux_session() send_keys(self.session_name, '\n' + self.verification_string) @assert_after_timeout def _assertion(): self.assertIn(self.verification_string, self.get_tmux_session_contents()) _assertion()
def test_lookup_keys_are_sent_to_session(self): self.start_tmux_session() send_keys(self.session_name, 'echo "Hello, {}"'.format(self.verification_string)) send_keys(self.session_name, 'Enter', literal=False) @assert_after_timeout def _assertion(): session_contents = self.get_tmux_session_contents() self.assertEqual(2, session_contents.count(self.verification_string)) _assertion()
def test_wrong_session_raises_session_not_found_error(self): self.start_tmux_session() with self.assertRaises(SessionNotFoundError): send_keys(self.session_name + '__', self.verification_string)
def test_no_server_raises_connection_failed_error(self): with self.assertRaises(ConnectionFailedError): send_keys(self.session_name, self.verification_string)
def main(): oraide.send_keys('oraide-example', "echo 'Hello, world!'") oraide.send_keys('oraide-example', oraide.keyboard.enter, literal=False)