2 # Copyright (c) 2011 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file.
11 import pyauto_functional
12 import pyauto
# pyauto_functional must come before pyauto
14 class ChromeosCellularSanity(pyauto
.PyUITest
):
15 """Tests for ChromeOS network related functions."""
17 assert os
.popen('modem status').read(), 'Device needs modem to run test.'
19 def testConnectCellularNetwork(self
):
20 """Connect to the cellular network if present."""
22 self
.ConnectToCellularNetwork()
23 self
.assertTrue(self
.NetworkScan().get('connected_cellular'),
24 'Failed to connect to cellular network.')
25 self
.DisconnectFromCellularNetwork()
26 self
.assertFalse(self
.NetworkScan().get('connected_cellular'),
27 'Failed to disconnect from cellular network.')
30 if __name__
== '__main__':
31 pyauto_functional
.Main()