зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1317970 - Make mozbase tests use mozunit for consistent formatting, r=chmanchester
The mozbase unittests don't use mozunit, so their output is confusing in the log. This makes mozbase output consistent with the rest of the python unittests. MozReview-Commit-ID: AIs5mza8Rn6 --HG-- extra : rebase_source : 10f65e612f5b3cebb921c47699f5a8be7cd2ba5a
This commit is contained in:
Родитель
f395e4d6dd
Коммит
2d76b4f70d
|
@ -5,6 +5,8 @@ from unittest import TestCase
|
|||
import os
|
||||
import random
|
||||
|
||||
import mozunit
|
||||
|
||||
from manifestparser.filters import (
|
||||
chunk_by_dir,
|
||||
chunk_by_runtime,
|
||||
|
@ -300,3 +302,7 @@ class ChunkByRuntime(TestCase):
|
|||
'c/e': 1,
|
||||
}
|
||||
self.run_all_combos(dirs)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
mozunit.main()
|
||||
|
|
|
@ -9,6 +9,8 @@ import shutil
|
|||
import tempfile
|
||||
import unittest
|
||||
|
||||
import mozunit
|
||||
|
||||
from manifestparser import convert
|
||||
from manifestparser import ManifestParser
|
||||
|
||||
|
@ -178,4 +180,4 @@ class TestDirectoryConversion(unittest.TestCase):
|
|||
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
mozunit.main()
|
||||
|
|
|
@ -9,6 +9,8 @@ import shutil
|
|||
import tempfile
|
||||
import unittest
|
||||
|
||||
import mozunit
|
||||
|
||||
from manifestparser import convert, ManifestParser
|
||||
|
||||
|
||||
|
@ -136,4 +138,4 @@ class TestSymlinkConversion(unittest.TestCase):
|
|||
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
mozunit.main()
|
||||
|
|
|
@ -6,6 +6,9 @@
|
|||
|
||||
import os
|
||||
import unittest
|
||||
|
||||
import mozunit
|
||||
|
||||
from manifestparser import ManifestParser
|
||||
from manifestparser import combine_fields
|
||||
|
||||
|
@ -112,4 +115,4 @@ class TestSubsuiteDefaults(unittest.TestCase):
|
|||
value['subsuite'])
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
mozunit.main()
|
||||
|
|
|
@ -1,6 +1,9 @@
|
|||
#!/usr/bin/env python
|
||||
|
||||
import unittest
|
||||
|
||||
import mozunit
|
||||
|
||||
from manifestparser import parse
|
||||
|
||||
|
||||
|
@ -149,4 +152,4 @@ class ExpressionParserTest(unittest.TestCase):
|
|||
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
mozunit.main()
|
||||
|
|
|
@ -5,6 +5,8 @@ from copy import deepcopy
|
|||
import os
|
||||
import unittest
|
||||
|
||||
import mozunit
|
||||
|
||||
from manifestparser.filters import (
|
||||
subsuite,
|
||||
tags,
|
||||
|
@ -180,3 +182,7 @@ class BuiltinFilters(unittest.TestCase):
|
|||
tests = list(ftags2(tests, {}))
|
||||
self.assertEquals(len(tests), 1)
|
||||
self.assertIn(self.tests[7], tests)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
mozunit.main()
|
||||
|
|
|
@ -8,9 +8,12 @@ import os
|
|||
import shutil
|
||||
import tempfile
|
||||
import unittest
|
||||
from manifestparser import ManifestParser
|
||||
from StringIO import StringIO
|
||||
|
||||
import mozunit
|
||||
|
||||
from manifestparser import ManifestParser
|
||||
|
||||
here = os.path.dirname(os.path.abspath(__file__))
|
||||
|
||||
|
||||
|
@ -322,4 +325,4 @@ yellow = submarine""" # noqa
|
|||
self.assertTrue(len(parser.manifests()) == 1)
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
mozunit.main()
|
||||
|
|
|
@ -15,6 +15,8 @@ from manifestparser import read_ini
|
|||
from ConfigParser import ConfigParser
|
||||
from StringIO import StringIO
|
||||
|
||||
import mozunit
|
||||
|
||||
|
||||
class IniParserTest(unittest.TestCase):
|
||||
|
||||
|
@ -67,4 +69,4 @@ kittens = true # This test requires kittens
|
|||
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
mozunit.main()
|
||||
|
|
|
@ -5,6 +5,8 @@ import shutil
|
|||
import tempfile
|
||||
import unittest
|
||||
|
||||
import mozunit
|
||||
|
||||
from manifestparser import TestManifest, ParseError
|
||||
from manifestparser.filters import subsuite
|
||||
|
||||
|
@ -119,4 +121,4 @@ class TestTestManifest(unittest.TestCase):
|
|||
self.assertEqual(len(empty_manifest.active_tests()), 0)
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
mozunit.main()
|
||||
|
|
|
@ -12,6 +12,9 @@ import shutil
|
|||
import urlparse
|
||||
import zipfile
|
||||
import StringIO
|
||||
|
||||
import mozunit
|
||||
|
||||
import mozcrash
|
||||
import mozhttpd
|
||||
import mozlog.unstructured as mozlog
|
||||
|
@ -238,4 +241,4 @@ class TestJavaException(unittest.TestCase):
|
|||
self.assert_(not mozcrash.check_for_java_exception(passable_log, quiet=True))
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
mozunit.main()
|
||||
|
|
|
@ -3,6 +3,8 @@ import mozdevice
|
|||
import logging
|
||||
import unittest
|
||||
|
||||
import mozunit
|
||||
|
||||
|
||||
class LaunchTest(unittest.TestCase):
|
||||
|
||||
|
@ -33,4 +35,4 @@ class LaunchTest(unittest.TestCase):
|
|||
a.wait()
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
mozunit.main()
|
||||
|
|
|
@ -2,6 +2,9 @@
|
|||
import mozdevice
|
||||
import logging
|
||||
import unittest
|
||||
|
||||
import mozunit
|
||||
|
||||
from sut import MockAgent
|
||||
|
||||
|
||||
|
@ -17,4 +20,4 @@ class TestApp(unittest.TestCase):
|
|||
self.assertEqual(command[0][1], d.getAppRoot('org.mozilla.firefox'))
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
mozunit.main()
|
||||
|
|
|
@ -3,6 +3,8 @@ import mozdevice
|
|||
import logging
|
||||
import unittest
|
||||
|
||||
import mozunit
|
||||
|
||||
|
||||
class BasicTest(unittest.TestCase):
|
||||
|
||||
|
@ -70,4 +72,4 @@ class BasicTest(unittest.TestCase):
|
|||
a.wait()
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
mozunit.main()
|
||||
|
|
|
@ -2,6 +2,9 @@
|
|||
import mozdevice
|
||||
import logging
|
||||
import unittest
|
||||
|
||||
import mozunit
|
||||
|
||||
from sut import MockAgent
|
||||
|
||||
|
||||
|
@ -19,4 +22,4 @@ class TestChmod(unittest.TestCase):
|
|||
self.assertEqual(None, d.chmodDir('/mnt/sdcard/test'))
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
mozunit.main()
|
||||
|
|
|
@ -8,6 +8,9 @@
|
|||
import mozdevice
|
||||
import logging
|
||||
import unittest
|
||||
|
||||
import mozunit
|
||||
|
||||
from sut import MockAgent
|
||||
|
||||
|
||||
|
@ -64,4 +67,4 @@ class CopyTreeTest(unittest.TestCase):
|
|||
self.assertTrue(d.fileExists('/mnt/sdcard/tests/foo2/bar'))
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
mozunit.main()
|
||||
|
|
|
@ -1,7 +1,10 @@
|
|||
from sut import MockAgent
|
||||
import mozdevice
|
||||
import unittest
|
||||
|
||||
import mozunit
|
||||
|
||||
import mozdevice
|
||||
from sut import MockAgent
|
||||
|
||||
|
||||
class FileExistsTest(unittest.TestCase):
|
||||
|
||||
|
@ -26,4 +29,4 @@ class FileExistsTest(unittest.TestCase):
|
|||
self.assertTrue(d.fileExists('/init'))
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
mozunit.main()
|
||||
|
|
|
@ -6,6 +6,9 @@ import logging
|
|||
import shutil
|
||||
import tempfile
|
||||
import unittest
|
||||
|
||||
import mozunit
|
||||
|
||||
from sut import MockAgent
|
||||
|
||||
|
||||
|
@ -69,4 +72,4 @@ class TestFileMethods(unittest.TestCase):
|
|||
shutil.rmtree(tmpdir)
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
mozunit.main()
|
||||
|
|
|
@ -3,6 +3,9 @@ import mozdevice
|
|||
import logging
|
||||
import re
|
||||
import unittest
|
||||
|
||||
import mozunit
|
||||
|
||||
from sut import MockAgent
|
||||
|
||||
|
||||
|
@ -46,4 +49,4 @@ class TestGetInfo(unittest.TestCase):
|
|||
self.assertEqual(d.getInfo(directive=directive)[directive], expected)
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
mozunit.main()
|
||||
|
|
|
@ -2,6 +2,9 @@
|
|||
import mozdevice
|
||||
import logging
|
||||
import unittest
|
||||
|
||||
import mozunit
|
||||
|
||||
from sut import MockAgent
|
||||
|
||||
|
||||
|
@ -34,4 +37,4 @@ class TestGetIP(unittest.TestCase):
|
|||
self.assertRaises(mozdevice.DMError, d.getIP, interfaces=['fake0'])
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
mozunit.main()
|
||||
|
|
|
@ -3,6 +3,9 @@
|
|||
import mozdevice
|
||||
import logging
|
||||
import unittest
|
||||
|
||||
import mozunit
|
||||
|
||||
from sut import MockAgent
|
||||
|
||||
|
||||
|
@ -21,4 +24,4 @@ class TestKill(unittest.TestCase):
|
|||
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
mozunit.main()
|
||||
|
|
|
@ -2,6 +2,9 @@
|
|||
import mozdevice
|
||||
import logging
|
||||
import unittest
|
||||
|
||||
import mozunit
|
||||
|
||||
from sut import MockAgent
|
||||
|
||||
|
||||
|
@ -19,4 +22,4 @@ class TestListFiles(unittest.TestCase):
|
|||
self.assertEqual(expected, d.listFiles("/mnt/sdcard"))
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
mozunit.main()
|
||||
|
|
|
@ -3,6 +3,9 @@
|
|||
import mozdevice
|
||||
import logging
|
||||
import unittest
|
||||
|
||||
import mozunit
|
||||
|
||||
from sut import MockAgent
|
||||
|
||||
|
||||
|
@ -49,4 +52,4 @@ class TestLogCat(unittest.TestCase):
|
|||
self.assertEqual(None, d.recordLogcat())
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
mozunit.main()
|
||||
|
|
|
@ -4,6 +4,9 @@
|
|||
import mozdevice
|
||||
import logging
|
||||
import unittest
|
||||
|
||||
import mozunit
|
||||
|
||||
from sut import MockAgent
|
||||
|
||||
|
||||
|
@ -75,4 +78,4 @@ class MkDirsTest(unittest.TestCase):
|
|||
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
mozunit.main()
|
||||
|
|
|
@ -8,6 +8,9 @@
|
|||
import mozdevice
|
||||
import logging
|
||||
import unittest
|
||||
|
||||
import mozunit
|
||||
|
||||
from sut import MockAgent
|
||||
|
||||
|
||||
|
@ -62,4 +65,4 @@ class MoveTreeTest(unittest.TestCase):
|
|||
self.assertTrue(d.fileExists('/mnt/sdcard/tests/foo2/bar'))
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
mozunit.main()
|
||||
|
|
|
@ -2,6 +2,8 @@ from sut import MockAgent
|
|||
import mozdevice
|
||||
import unittest
|
||||
|
||||
import mozunit
|
||||
|
||||
|
||||
class PsTest(unittest.TestCase):
|
||||
|
||||
|
@ -47,4 +49,4 @@ class PsTest(unittest.TestCase):
|
|||
a.wait()
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
mozunit.main()
|
||||
|
|
|
@ -3,6 +3,8 @@ import mozdevice
|
|||
import logging
|
||||
import unittest
|
||||
|
||||
import mozunit
|
||||
|
||||
|
||||
class PullTest(unittest.TestCase):
|
||||
|
||||
|
@ -44,4 +46,4 @@ class PullTest(unittest.TestCase):
|
|||
self.assertTrue(exceptionThrown)
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
mozunit.main()
|
||||
|
|
|
@ -7,6 +7,8 @@ import hashlib
|
|||
import tempfile
|
||||
import os
|
||||
|
||||
import mozunit
|
||||
|
||||
|
||||
class PushTest(unittest.TestCase):
|
||||
|
||||
|
@ -85,4 +87,4 @@ class PushTest(unittest.TestCase):
|
|||
# FIXME: delete directory when done
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
mozunit.main()
|
||||
|
|
|
@ -2,6 +2,9 @@
|
|||
import mozdevice
|
||||
import logging
|
||||
import unittest
|
||||
|
||||
import mozunit
|
||||
|
||||
from sut import MockAgent
|
||||
|
||||
|
||||
|
@ -21,4 +24,4 @@ class TestRemove(unittest.TestCase):
|
|||
self.assertEqual(None, d.removeDir("/mnt/sdcard/test"))
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
mozunit.main()
|
||||
|
|
|
@ -2,6 +2,9 @@
|
|||
import mozdevice
|
||||
import logging
|
||||
import unittest
|
||||
|
||||
import mozunit
|
||||
|
||||
from sut import MockAgent
|
||||
|
||||
|
||||
|
@ -15,4 +18,4 @@ class TestGetCurrentTime(unittest.TestCase):
|
|||
self.assertEqual(d.getCurrentTime(), int(command[0][1]))
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
mozunit.main()
|
||||
|
|
|
@ -3,6 +3,9 @@
|
|||
import mozdevice
|
||||
import logging
|
||||
import unittest
|
||||
|
||||
import mozunit
|
||||
|
||||
from sut import MockAgent
|
||||
|
||||
|
||||
|
@ -20,4 +23,4 @@ class TestUnpack(unittest.TestCase):
|
|||
"/data/test/"))
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
mozunit.main()
|
||||
|
|
|
@ -7,6 +7,8 @@ import tempfile
|
|||
import unittest
|
||||
import zipfile
|
||||
|
||||
import mozunit
|
||||
|
||||
import mozfile
|
||||
|
||||
import stubs
|
||||
|
@ -152,3 +154,7 @@ class TestExtract(unittest.TestCase):
|
|||
shutil.rmtree(tempdir)
|
||||
archive.close()
|
||||
return filename
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
mozunit.main()
|
||||
|
|
|
@ -8,6 +8,9 @@ import mozhttpd
|
|||
import os
|
||||
import tempfile
|
||||
import unittest
|
||||
|
||||
import mozunit
|
||||
|
||||
from mozfile import load
|
||||
|
||||
|
||||
|
@ -59,4 +62,4 @@ class TestLoad(unittest.TestCase):
|
|||
os.remove(tmp.name)
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
mozunit.main()
|
||||
|
|
|
@ -9,6 +9,8 @@ import unittest
|
|||
import errno
|
||||
from contextlib import contextmanager
|
||||
|
||||
import mozunit
|
||||
|
||||
import mozfile
|
||||
import mozinfo
|
||||
|
||||
|
@ -229,4 +231,4 @@ class MozFileMoveTestCase(unittest.TestCase):
|
|||
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
mozunit.main()
|
||||
|
|
|
@ -12,6 +12,8 @@ from mozfile import TemporaryDirectory
|
|||
import os
|
||||
import unittest
|
||||
|
||||
import mozunit
|
||||
|
||||
|
||||
class TestTemporaryDirectory(unittest.TestCase):
|
||||
|
||||
|
@ -39,4 +41,4 @@ class TestTemporaryDirectory(unittest.TestCase):
|
|||
self.assertFalse(os.path.exists(path))
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
mozunit.main()
|
||||
|
|
|
@ -12,6 +12,8 @@ import mozfile
|
|||
import os
|
||||
import unittest
|
||||
|
||||
import mozunit
|
||||
|
||||
|
||||
class TestNamedTemporaryFile(unittest.TestCase):
|
||||
"""test our fix for NamedTemporaryFile"""
|
||||
|
@ -99,4 +101,4 @@ class TestNamedTemporaryFile(unittest.TestCase):
|
|||
os.remove(path)
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
mozunit.main()
|
||||
|
|
|
@ -7,6 +7,8 @@ tests for is_url
|
|||
import unittest
|
||||
from mozfile import is_url
|
||||
|
||||
import mozunit
|
||||
|
||||
|
||||
class TestIsUrl(unittest.TestCase):
|
||||
"""test the is_url function"""
|
||||
|
@ -18,4 +20,4 @@ class TestIsUrl(unittest.TestCase):
|
|||
self.assertFalse(is_url('c:\foo\bar'))
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
mozunit.main()
|
||||
|
|
|
@ -12,6 +12,8 @@ import unittest
|
|||
import json
|
||||
import tempfile
|
||||
|
||||
import mozunit
|
||||
|
||||
here = os.path.dirname(os.path.abspath(__file__))
|
||||
|
||||
|
||||
|
@ -263,4 +265,4 @@ class ProxyTest(unittest.TestCase):
|
|||
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
mozunit.main()
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
import mozhttpd
|
||||
import unittest
|
||||
|
||||
import mozunit
|
||||
|
||||
|
||||
class BaseUrlTest(unittest.TestCase):
|
||||
|
||||
|
@ -16,4 +18,4 @@ class BaseUrlTest(unittest.TestCase):
|
|||
httpd.stop()
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
mozunit.main()
|
||||
|
|
|
@ -6,6 +6,8 @@ import os
|
|||
import tempfile
|
||||
import unittest
|
||||
|
||||
import mozunit
|
||||
|
||||
|
||||
class TestBasic(unittest.TestCase):
|
||||
""" Test basic Mozhttpd capabilites """
|
||||
|
@ -43,4 +45,4 @@ class TestBasic(unittest.TestCase):
|
|||
mozfile.rmtree(tempdir)
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
mozunit.main()
|
||||
|
|
|
@ -10,6 +10,8 @@ import os
|
|||
import unittest
|
||||
import re
|
||||
|
||||
import mozunit
|
||||
|
||||
here = os.path.dirname(os.path.abspath(__file__))
|
||||
|
||||
|
||||
|
@ -40,4 +42,4 @@ class FileListingTest(unittest.TestCase):
|
|||
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
mozunit.main()
|
||||
|
|
|
@ -9,6 +9,8 @@ import os
|
|||
import unittest
|
||||
import urllib2
|
||||
|
||||
import mozunit
|
||||
|
||||
|
||||
class PathTest(unittest.TestCase):
|
||||
|
||||
|
@ -74,4 +76,4 @@ class PathTest(unittest.TestCase):
|
|||
httpd.stop()
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
mozunit.main()
|
||||
|
|
|
@ -7,6 +7,8 @@ import urllib2
|
|||
import os
|
||||
import unittest
|
||||
|
||||
import mozunit
|
||||
|
||||
here = os.path.dirname(os.path.abspath(__file__))
|
||||
|
||||
|
||||
|
@ -38,4 +40,4 @@ class RequestLogTest(unittest.TestCase):
|
|||
self.assertEqual(len(request_log), 0)
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
mozunit.main()
|
||||
|
|
|
@ -13,6 +13,8 @@ import tempfile
|
|||
import unittest
|
||||
import mozinfo
|
||||
|
||||
import mozunit
|
||||
|
||||
|
||||
class TestMozinfo(unittest.TestCase):
|
||||
|
||||
|
@ -118,4 +120,4 @@ class TestStringVersion(unittest.TestCase):
|
|||
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
mozunit.main()
|
||||
|
|
|
@ -11,6 +11,8 @@ import os
|
|||
import tempfile
|
||||
import unittest
|
||||
|
||||
import mozunit
|
||||
|
||||
# Store file location at load time
|
||||
here = os.path.dirname(os.path.abspath(__file__))
|
||||
|
||||
|
@ -166,4 +168,4 @@ class TestMozInstall(unittest.TestCase):
|
|||
self.assertFalse(os.path.exists(installdir))
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
mozunit.main()
|
||||
|
|
|
@ -9,8 +9,9 @@ import threading
|
|||
import time
|
||||
import unittest
|
||||
|
||||
import mozfile
|
||||
import mozunit
|
||||
|
||||
import mozfile
|
||||
import mozlog.unstructured as mozlog
|
||||
|
||||
|
||||
|
@ -232,7 +233,7 @@ class TestLoggingMixin(unittest.TestCase):
|
|||
self.assertTrue(not hasattr(loggable, "_logger"))
|
||||
loggable.log(mozlog.INFO, "This will instantiate the logger")
|
||||
self.assertTrue(hasattr(loggable, "_logger"))
|
||||
self.assertEqual(loggable._logger.name, "test_logger.Loggable")
|
||||
self.assertEqual(loggable._logger.name, "__main__.Loggable")
|
||||
|
||||
self.assertRaises(ValueError, loggable.set_logger,
|
||||
"not a logger")
|
||||
|
@ -261,4 +262,4 @@ class TestLoggingMixin(unittest.TestCase):
|
|||
self.assertEqual(expected_messages, actual_messages)
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
mozunit.main()
|
||||
|
|
|
@ -9,8 +9,9 @@ import unittest
|
|||
import signal
|
||||
import xml.etree.ElementTree as ET
|
||||
|
||||
import mozfile
|
||||
import mozunit
|
||||
|
||||
import mozfile
|
||||
from mozlog import (
|
||||
commandline,
|
||||
reader,
|
||||
|
@ -1095,4 +1096,4 @@ class TestReader(unittest.TestCase):
|
|||
self.assertEquals(handler.action_1_count, 1)
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
mozunit.main()
|
||||
|
|
|
@ -11,6 +11,8 @@ import re
|
|||
import subprocess
|
||||
import unittest
|
||||
|
||||
import mozunit
|
||||
|
||||
|
||||
def verify_ip_in_list(ip):
|
||||
"""
|
||||
|
@ -82,4 +84,4 @@ class TestGetIP(unittest.TestCase):
|
|||
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
mozunit.main()
|
||||
|
|
|
@ -7,8 +7,10 @@
|
|||
import os
|
||||
import subprocess
|
||||
import sys
|
||||
import unittest
|
||||
import proctest
|
||||
|
||||
import mozunit
|
||||
|
||||
from mozprocess import processhandler
|
||||
|
||||
here = os.path.dirname(os.path.abspath(__file__))
|
||||
|
@ -232,4 +234,4 @@ class ProcTest(proctest.ProcTest):
|
|||
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
mozunit.main()
|
||||
|
|
|
@ -5,6 +5,9 @@ import time
|
|||
import unittest
|
||||
import proctest
|
||||
import signal
|
||||
|
||||
import mozunit
|
||||
|
||||
from mozprocess import processhandler
|
||||
|
||||
here = os.path.dirname(os.path.abspath(__file__))
|
||||
|
@ -88,4 +91,4 @@ class ProcTestKill(proctest.ProcTest):
|
|||
self.assertEquals(p.proc.returncode, -signal.SIGKILL)
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
mozunit.main()
|
||||
|
|
|
@ -2,8 +2,10 @@
|
|||
|
||||
import os
|
||||
import time
|
||||
import unittest
|
||||
import proctest
|
||||
|
||||
import mozunit
|
||||
|
||||
from mozprocess import processhandler
|
||||
|
||||
here = os.path.dirname(os.path.abspath(__file__))
|
||||
|
@ -30,4 +32,4 @@ class ProcTestKill(proctest.ProcTest):
|
|||
self.determine_status(p, expectedfail=('returncode',))
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
mozunit.main()
|
||||
|
|
|
@ -2,7 +2,9 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
|
||||
import os
|
||||
import unittest
|
||||
|
||||
import mozunit
|
||||
|
||||
import proctest
|
||||
from mozprocess import processhandler
|
||||
|
||||
|
@ -38,4 +40,4 @@ class ProcTestMisc(proctest.ProcTest):
|
|||
p.wait()
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
mozunit.main()
|
||||
|
|
|
@ -2,7 +2,9 @@
|
|||
|
||||
import io
|
||||
import os
|
||||
import unittest
|
||||
|
||||
import mozunit
|
||||
|
||||
import proctest
|
||||
from mozprocess import processhandler
|
||||
|
||||
|
@ -54,4 +56,4 @@ class ProcTestOutput(proctest.ProcTest):
|
|||
self.determine_status(p, False, ())
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
mozunit.main()
|
||||
|
|
|
@ -5,6 +5,9 @@
|
|||
# You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
import unittest
|
||||
|
||||
import mozunit
|
||||
|
||||
from mozprocess import processhandler
|
||||
|
||||
|
||||
|
@ -77,8 +80,5 @@ class ParamTests(unittest.TestCase):
|
|||
self.assertFalse(err)
|
||||
|
||||
|
||||
def main():
|
||||
unittest.main()
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
mozunit.main()
|
||||
|
|
|
@ -2,7 +2,8 @@
|
|||
|
||||
import os
|
||||
import signal
|
||||
import unittest
|
||||
|
||||
import mozunit
|
||||
|
||||
from mozprocess import processhandler
|
||||
|
||||
|
@ -103,4 +104,4 @@ class ProcTestPoll(proctest.ProcTest):
|
|||
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
mozunit.main()
|
||||
|
|
|
@ -1,9 +1,11 @@
|
|||
#!/usr/bin/env python
|
||||
|
||||
import os
|
||||
import unittest
|
||||
import proctest
|
||||
import mozinfo
|
||||
|
||||
import mozunit
|
||||
|
||||
from mozprocess import processhandler
|
||||
|
||||
here = os.path.dirname(os.path.abspath(__file__))
|
||||
|
@ -93,4 +95,4 @@ class ProcTestWait(proctest.ProcTest):
|
|||
'Expected both returncodes of wait() to be equal')
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
mozunit.main()
|
||||
|
|
|
@ -1,6 +1,9 @@
|
|||
import unittest
|
||||
import subprocess
|
||||
import sys
|
||||
|
||||
import mozunit
|
||||
|
||||
from mozprocess.processhandler import ProcessReader, StoreOutput
|
||||
|
||||
|
||||
|
@ -97,5 +100,6 @@ class TestProcessReader(unittest.TestCase):
|
|||
self.assertEqual(sorted(self.out.output), sorted(['1', '2', 'hello world']))
|
||||
self.assertEqual(self.err.output, [])
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
mozunit.main()
|
||||
|
|
|
@ -4,6 +4,9 @@ import os
|
|||
import tempfile
|
||||
import unittest
|
||||
import shutil
|
||||
|
||||
import mozunit
|
||||
|
||||
from mozprofile import addons
|
||||
|
||||
|
||||
|
@ -181,4 +184,4 @@ class AddonIDTest(unittest.TestCase):
|
|||
return tests
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
mozunit.main()
|
||||
|
|
|
@ -6,6 +6,8 @@ import shutil
|
|||
import tempfile
|
||||
import unittest
|
||||
|
||||
import mozunit
|
||||
|
||||
|
||||
here = os.path.dirname(os.path.abspath(__file__))
|
||||
|
||||
|
@ -50,4 +52,4 @@ class Bug758250(unittest.TestCase):
|
|||
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
mozunit.main()
|
||||
|
|
|
@ -10,6 +10,9 @@ import shutil
|
|||
import sqlite3
|
||||
import tempfile
|
||||
import unittest
|
||||
|
||||
import mozunit
|
||||
|
||||
from mozprofile.permissions import Permissions
|
||||
|
||||
|
||||
|
@ -48,4 +51,4 @@ http://127.0.0.1:8888 privileged
|
|||
self.assertEqual(schema_version, 5)
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
mozunit.main()
|
||||
|
|
|
@ -10,6 +10,9 @@ import shutil
|
|||
import sqlite3
|
||||
import tempfile
|
||||
import unittest
|
||||
|
||||
import mozunit
|
||||
|
||||
from mozprofile.permissions import Permissions
|
||||
|
||||
|
||||
|
@ -196,4 +199,4 @@ http://127.0.0.1:8888 privileged
|
|||
self.verify_user_version(5)
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
mozunit.main()
|
||||
|
|
|
@ -6,6 +6,9 @@
|
|||
|
||||
import mozfile
|
||||
import unittest
|
||||
|
||||
import mozunit
|
||||
|
||||
from mozprofile.permissions import ServerLocations, \
|
||||
MissingPrimaryLocationError, MultiplePrimaryLocationsError, \
|
||||
DuplicateLocationError, BadPortLocationError, LocationsSyntaxError
|
||||
|
@ -148,4 +151,4 @@ http://example.org:80 privileged
|
|||
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
mozunit.main()
|
||||
|
|
|
@ -10,6 +10,8 @@ import tempfile
|
|||
import unittest
|
||||
import urllib2
|
||||
|
||||
import mozunit
|
||||
|
||||
from manifestparser import ManifestParser
|
||||
import mozfile
|
||||
import mozhttpd
|
||||
|
@ -412,4 +414,4 @@ class TestAddonsManager(unittest.TestCase):
|
|||
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
mozunit.main()
|
||||
|
|
|
@ -10,6 +10,8 @@ import tempfile
|
|||
import unittest
|
||||
import mozfile
|
||||
|
||||
import mozunit
|
||||
|
||||
from mozprofile.profile import Profile
|
||||
|
||||
|
||||
|
@ -60,4 +62,4 @@ class CloneCleanupTest(unittest.TestCase):
|
|||
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
mozunit.main()
|
||||
|
|
|
@ -9,6 +9,9 @@ import os
|
|||
import tempfile
|
||||
import unittest
|
||||
import mozfile
|
||||
|
||||
import mozunit
|
||||
|
||||
from mozprofile.prefs import Preferences
|
||||
from mozprofile.profile import Profile
|
||||
|
||||
|
@ -46,4 +49,4 @@ class PreferencesNonceTest(unittest.TestCase):
|
|||
self.assertEqual(dict(prefs), {'foo': 'bar'})
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
mozunit.main()
|
||||
|
|
|
@ -10,6 +10,9 @@ import os
|
|||
import shutil
|
||||
import tempfile
|
||||
import unittest
|
||||
|
||||
import mozunit
|
||||
|
||||
from mozprofile.cli import MozProfileCLI
|
||||
from mozprofile.prefs import Preferences
|
||||
from mozprofile.profile import Profile
|
||||
|
@ -375,4 +378,4 @@ user_pref("webgl.force-enabled", true);
|
|||
httpd.stop()
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
mozunit.main()
|
||||
|
|
|
@ -6,6 +6,9 @@
|
|||
|
||||
import unittest
|
||||
import os
|
||||
|
||||
import mozunit
|
||||
|
||||
from mozprofile import Profile
|
||||
|
||||
|
||||
|
@ -27,4 +30,4 @@ class TestProfile(unittest.TestCase):
|
|||
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
mozunit.main()
|
||||
|
|
|
@ -10,6 +10,8 @@ import os
|
|||
import tempfile
|
||||
import unittest
|
||||
|
||||
import mozunit
|
||||
|
||||
here = os.path.dirname(os.path.abspath(__file__))
|
||||
|
||||
|
||||
|
@ -72,4 +74,4 @@ class TestProfilePrint(unittest.TestCase):
|
|||
self.assertTrue(set(ff_pref_lines).issubset(lines))
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
mozunit.main()
|
||||
|
|
|
@ -9,6 +9,8 @@ import shutil
|
|||
import unittest
|
||||
from tempfile import mkdtemp
|
||||
|
||||
import mozunit
|
||||
|
||||
from mozprofile.webapps import WebappCollection, Webapp, WebappFormatException
|
||||
|
||||
here = os.path.dirname(os.path.abspath(__file__))
|
||||
|
@ -199,4 +201,4 @@ class WebappTest(unittest.TestCase):
|
|||
self.assertEqual(webapps_json, manifest_json_2)
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
mozunit.main()
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
# You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
import mock
|
||||
import mozunit
|
||||
|
||||
import mozrunnertest
|
||||
|
||||
|
@ -35,3 +36,7 @@ class MozrunnerCrashTestCase(mozrunnertest.MozrunnerTestCase):
|
|||
check_for_crashes.return_value = 0
|
||||
self.assertEqual(self.runner.check_for_crashes(), 0)
|
||||
self.assertEqual(self.runner.crashed, 4)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
mozunit.main()
|
||||
|
|
|
@ -3,6 +3,8 @@
|
|||
import threading
|
||||
from time import sleep
|
||||
|
||||
import mozunit
|
||||
|
||||
import mozrunnertest
|
||||
|
||||
|
||||
|
@ -51,3 +53,7 @@ class MozrunnerInteractiveTestCase(mozrunnertest.MozrunnerTestCase):
|
|||
|
||||
self.assertNotIn(returncode, [None, 0])
|
||||
self.assertIsNotNone(self.runner.process_handler)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
mozunit.main()
|
||||
|
|
|
@ -2,6 +2,8 @@
|
|||
|
||||
from time import sleep
|
||||
|
||||
import mozunit
|
||||
|
||||
import mozrunnertest
|
||||
|
||||
|
||||
|
@ -43,3 +45,7 @@ class MozrunnerStartTestCase(mozrunnertest.MozrunnerTestCase):
|
|||
sleep(15)
|
||||
|
||||
self.assertFalse(self.runner.is_running())
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
mozunit.main()
|
||||
|
|
|
@ -2,6 +2,8 @@
|
|||
|
||||
import mozrunner
|
||||
|
||||
import mozunit
|
||||
|
||||
import mozrunnertest
|
||||
|
||||
|
||||
|
@ -16,3 +18,7 @@ class MozrunnerStatesTestCase(mozrunnertest.MozrunnerTestCase):
|
|||
self.assertRaises(mozrunner.RunnerNotStartedError, self.runner.is_running)
|
||||
self.assertRaises(mozrunner.RunnerNotStartedError, test_returncode)
|
||||
self.assertRaises(mozrunner.RunnerNotStartedError, self.runner.wait)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
mozunit.main()
|
||||
|
|
|
@ -5,6 +5,8 @@
|
|||
|
||||
import signal
|
||||
|
||||
import mozunit
|
||||
|
||||
import mozrunnertest
|
||||
|
||||
|
||||
|
@ -37,3 +39,7 @@ class MozrunnerStopTestCase(mozrunnertest.MozrunnerTestCase):
|
|||
self.assertIsNotNone(self.runner.process_handler)
|
||||
|
||||
self.assertEqual(self.runner.wait(1), returncode)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
mozunit.main()
|
||||
|
|
|
@ -6,6 +6,8 @@
|
|||
import threading
|
||||
from time import sleep
|
||||
|
||||
import mozunit
|
||||
|
||||
import mozrunnertest
|
||||
|
||||
|
||||
|
@ -71,3 +73,7 @@ class MozrunnerThreadsTestCase(mozrunnertest.MozrunnerTestCase):
|
|||
self.assertEqual(self.runner.returncode, returncode)
|
||||
self.assertIsNotNone(self.runner.process_handler)
|
||||
self.assertEqual(self.runner.wait(10), returncode)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
mozunit.main()
|
||||
|
|
|
@ -3,6 +3,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 mozunit
|
||||
import mozrunnertest
|
||||
|
||||
|
||||
|
@ -27,3 +28,7 @@ class MozrunnerWaitTestCase(mozrunnertest.MozrunnerTestCase):
|
|||
|
||||
self.assertNotIn(returncode, [None, 0])
|
||||
self.assertIsNotNone(self.runner.process_handler)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
mozunit.main()
|
||||
|
|
|
@ -6,6 +6,8 @@ import multiprocessing
|
|||
import time
|
||||
import unittest
|
||||
|
||||
import mozunit
|
||||
|
||||
try:
|
||||
import psutil
|
||||
except ImportError:
|
||||
|
@ -181,4 +183,4 @@ class TestResourceMonitor(unittest.TestCase):
|
|||
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
mozunit.main()
|
||||
|
|
|
@ -6,6 +6,8 @@ import math
|
|||
import time
|
||||
import unittest
|
||||
|
||||
import mozunit
|
||||
|
||||
from moztest.results import TestContext, TestResult, TestResultCollection
|
||||
|
||||
|
||||
|
@ -52,4 +54,4 @@ class Collection(unittest.TestCase):
|
|||
self.assertEqual(len(self.collection.contexts), 3)
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
mozunit.main()
|
||||
|
|
|
@ -7,6 +7,9 @@
|
|||
import mozfile
|
||||
import unittest
|
||||
import zipfile
|
||||
|
||||
import mozunit
|
||||
|
||||
from mozversion import get_version
|
||||
|
||||
|
||||
|
@ -40,4 +43,4 @@ class ApkTest(unittest.TestCase):
|
|||
self.assertEqual(v.get('package_name'), "org.mozilla.fennec")
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
mozunit.main()
|
||||
|
|
|
@ -9,6 +9,8 @@ import tempfile
|
|||
import unittest
|
||||
import zipfile
|
||||
|
||||
import mozunit
|
||||
|
||||
import mozfile
|
||||
from mozversion import get_version, errors
|
||||
|
||||
|
@ -72,4 +74,4 @@ class SourcesTest(unittest.TestCase):
|
|||
self.assertRaises(errors.RemoteAppNotFoundError, get_version)
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
mozunit.main()
|
||||
|
|
|
@ -10,8 +10,9 @@ import tempfile
|
|||
import shutil
|
||||
import unittest
|
||||
|
||||
import mozfile
|
||||
import mozunit
|
||||
|
||||
import mozfile
|
||||
from mozversion import errors, get_version
|
||||
|
||||
|
||||
|
@ -174,4 +175,4 @@ SourceRepository = PlatformSourceRepo
|
|||
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
mozunit.main()
|
||||
|
|
|
@ -8,8 +8,9 @@ import os
|
|||
import tempfile
|
||||
import unittest
|
||||
|
||||
import mozfile
|
||||
import mozunit
|
||||
|
||||
import mozfile
|
||||
from mozversion import errors, get_version
|
||||
|
||||
|
||||
|
@ -82,4 +83,4 @@ SourceRepository = PlatformSourceRepo
|
|||
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
mozunit.main()
|
||||
|
|
Загрузка…
Ссылка в новой задаче