~adam-disc0tech/ubuntu-autopilot-tests/test-runner

« back to all changes in this revision

Viewing changes to ubuntu_autopilot_tests/terminal/__init__.py

  • Committer: nskaggs
  • Date: 2013-07-30 18:31:48 UTC
  • mfrom: (56.1.3 terminal)
  • Revision ID: nicholas.skaggs@canonical.com-20130730183148-b70y7d85fc81gyxn
Add Dan's terminal test

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-
 
2
#
 
3
# Copyright (C) 2013
 
4
#
 
5
# Author: Daniel Chapman daniel@chapman-mail.com
 
6
#
 
7
# This program is free software; you can redistribute it and/or modify
 
8
# it under the terms of the GNU Lesser General Public License as published by
 
9
# the Free Software Foundation; version 3.
 
10
#
 
11
# This program is distributed in the hope that it will be useful,
 
12
# but WITHOUT ANY WARRANTY; without even the implied warranty of
 
13
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 
14
# GNU Lesser General Public License for more details.
 
15
#
 
16
# You should have received a copy of the GNU Lesser General Public License
 
17
# along with this program. If not, see <http://www.gnu.org/licenses/>.
 
18
from autopilot.testcase import AutopilotTestCase
 
19
from autopilot.matchers import Eventually
 
20
from testtools.matchers import Equals, Contains, FileExists, DirExists
 
21
import tempfile
 
22
import os
 
23
 
 
24
 
 
25
class TerminalAutopilotTestCase(AutopilotTestCase):
 
26
 
 
27
    def setUp(self):
 
28
        super(TerminalAutopilotTestCase, self).setUp()
 
29
        self.app = self.launch_test_application('gnome-terminal', '--disable-factory')
 
30
 
 
31
    def create_temp_directory_with_temp_files(self):
 
32
        """ Creates a temp directory with temp files 'a' 'b' and 'c' """
 
33
        self.keyboard.type('mkdir /tmp/temp-dir\n')
 
34
        self.keyboard.type('touch /tmp/temp-dir/a\n')
 
35
        self.keyboard.type('touch /tmp/temp-dir/b\n')
 
36
        self.keyboard.type('touch /tmp/temp-dir/c\n')