Bug 904292 - Clean up marionette pyflakes warnings;r=mdas

This commit is contained in:
William Lachance 2013-08-13 10:24:33 -07:00
parent 509aaed52a
commit 0bfb82e196
6 changed files with 10 additions and 22 deletions

View File

@ -7,19 +7,16 @@ import imp
import os
import re
import subprocess
import sys
import tempfile
import time
import types
import unittest
import weakref
from b2ginstance import B2GInstance
from client import MarionetteClient
from errors import MarionetteException, InvalidResponseException
from errors import InvalidResponseException
from marionette import Marionette
from marionette_test import MarionetteTestCase
from runtests import MarionetteTestRunner, cli, parse_options, startTestRunner
from runtests import MarionetteTestRunner, cli
class B2GUpdateMarionetteClient(MarionetteClient):
RETRY_TIMEOUT = 5
@ -361,7 +358,6 @@ class B2GUpdateTestCase(MarionetteTestCase):
self.fail('Timed out waiting for B2G process to start during FOTA update')
def flash(self, flash_script):
update_tools = self.runner.update_tools
flash_build = os.path.basename(os.path.dirname(flash_script))
self.print_status('FLASH-BUILD', flash_build)

View File

@ -13,7 +13,6 @@ import platform
import shutil
import socket
import subprocess
import sys
from telnetlib import Telnet
import tempfile
import time
@ -462,16 +461,14 @@ waitFor(
""" Set up TCP port forwarding to the specified port on the device,
using any availble local port, and return the local port.
"""
import socket
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.bind(("",0))
local_port = s.getsockname()[1]
s.close()
output = self._run_adb(['forward',
'tcp:%d' % local_port,
'tcp:%d' % remote_port])
self._run_adb(['forward',
'tcp:%d' % local_port,
'tcp:%d' % remote_port])
self.marionette_port = local_port

View File

@ -149,15 +149,15 @@ class Actions(object):
def flick(self, element, x1, y1, x2, y2, duration=200):
element = element.id
time = 0
elapsed = 0
time_increment = 10
if time_increment >= duration:
time_increment = duration
move_x = time_increment*1.0/duration * (x2 - x1)
move_y = time_increment*1.0/duration * (y2 - y1)
self.action_chain.append(['press', element, x1, y1])
while (time < duration):
time += time_increment
while elapsed < duration:
elapsed += time_increment
self.action_chain.append(['moveByOffset', move_x, move_y])
self.action_chain.append(['wait', time_increment/1000])
self.action_chain.append(['release'])

View File

@ -15,7 +15,7 @@ import weakref
import warnings
from errors import *
from marionette import HTMLElement, Marionette
from marionette import Marionette
class SkipTest(Exception):
"""

View File

@ -3,8 +3,6 @@
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from datetime import datetime
import imp
import inspect
import logging
from optparse import OptionParser
import os
@ -13,10 +11,8 @@ import socket
import sys
import time
import traceback
import platform
import moznetwork
import xml.dom.minidom as dom
from functools import wraps
from manifestparser import TestManifest
from mozhttpd import MozHttpd

View File

@ -2,8 +2,7 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
import time
from marionette import Marionette, HTMLElement
from marionette import Marionette
#
# Test that Marionette can manage multiple emulators.