/usr/lib/python2.7/dist-packages/address_book_app/tests/test_emulators.py is in address-book-app-autopilot 0.2+14.04.20140408.3-0ubuntu2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 | # -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-
#
# Copyright 2014 Canonical
#
# This file is part of address-book-app
#
# address-book-app is free software: you can redistribute it and/or
# modify it under the terms of the GNU General Public License version 3, as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
from address_book_app import tests
from address_book_app.emulators import main_window
class ContactEditorTestCase(tests.AddressBookAppTestCase):
def test_fill_form(self):
"""Test that the form can be filled with contact information."""
test_form_values = {
'first_name': 'Test first name',
'last_name': 'Test last name'
}
contact_editor = self.main_window.go_to_add_contact()
contact_editor.fill_form(test_form_values)
form_values = contact_editor._get_form_values()
self.assertEqual(test_form_values, form_values)
def test_fill_form_with_unknown_field_must_raise_error(self):
"""Test the error when you fill the form with an unknown field."""
test_form_values = {'unknown': 'dummy'}
contact_editor = self.main_window.go_to_add_contact()
error = self.assertRaises(
main_window.AddressBookAppError,
contact_editor.fill_form, test_form_values)
self.assertEqual('Unknown field: unknown.', str(error))
|