~abreu-alexandre/webbrowser-app/add-integration-tests-for-webappcontainer

« back to all changes in this revision

Viewing changes to tests/autopilot/webapp_container/tests/test_app_launch.py

  • Committer: Alexandre Abreu
  • Date: 2014-04-03 14:21:54 UTC
  • mfrom: (476.1.1 latest)
  • Revision ID: alexandre.abreu@canonical.com-20140403142154-rtnyduwfemp2of2x
merge trunk

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
# Copyright 2014 Canonical
 
3
#
 
4
# This program is free software: you can redistribute it and/or modify it
 
5
# under the terms of the GNU Lesser General Public License version 3, as
 
6
# published by the Free Software Foundation.
 
7
 
 
8
from __future__ import absolute_import
 
9
 
 
10
from testtools.matchers import Equals, NotEquals
 
11
from autopilot.matchers import Eventually
 
12
 
 
13
from webapp_container.tests import WebappContainerTestCaseWithLocalContentBase
 
14
 
 
15
 
 
16
class WebappContainerAppLaunchTestCase(
 
17
        WebappContainerTestCaseWithLocalContentBase):
 
18
 
 
19
    def test_container_does_not_load_with_no_webapp_name_and_url(self):
 
20
        args = ['--webapp']
 
21
        self.launch_webcontainer_app(args)
 
22
        self.assertThat(self.get_webcontainer_proxy(), Equals(None))
 
23
 
 
24
    def test_loads_with_url(self):
 
25
        args = ['--enable-addressbar']
 
26
        self.launch_webcontainer_app_with_local_http_server(args)
 
27
        self.assertThat(lambda: self.get_webcontainer_window().url, Eventually(Equals(self.url)))