Rev 4491: Cleanup imports. in file:///home/vila/src/bzr/experimental/cleanup-strict/
Vincent Ladeuil
v.ladeuil+lp at free.fr
Mon Jun 29 13:06:04 BST 2009
At file:///home/vila/src/bzr/experimental/cleanup-strict/
------------------------------------------------------------
revno: 4491
revision-id: v.ladeuil+lp at free.fr-20090629120604-s1mhzj8llocamvzr
parent: v.ladeuil+lp at free.fr-20090629110716-mxamvhasw9sb5xpo
committer: Vincent Ladeuil <v.ladeuil+lp at free.fr>
branch nick: cleanup-strict
timestamp: Mon 2009-06-29 14:06:04 +0200
message:
Cleanup imports.
-------------- next part --------------
=== modified file 'bzrlib/tests/test_config.py'
--- a/bzrlib/tests/test_config.py 2009-06-10 03:56:49 +0000
+++ b/bzrlib/tests/test_config.py 2009-06-29 12:06:04 +0000
@@ -18,7 +18,6 @@
"""Tests for finding and reading the bzr config file[s]."""
# import system imports here
from cStringIO import StringIO
-import getpass
import os
import sys
=== modified file 'bzrlib/tests/test_ui.py'
--- a/bzrlib/tests/test_ui.py 2009-06-17 05:16:48 +0000
+++ b/bzrlib/tests/test_ui.py 2009-06-29 12:06:04 +0000
@@ -23,21 +23,15 @@
import sys
import time
-import bzrlib
-import bzrlib.errors as errors
+from bzrlib import (
+ errors,
+ tests,
+ ui as _mod_ui,
+ )
from bzrlib.symbol_versioning import (
deprecated_in,
)
-from bzrlib.tests import (
- TestCase,
- TestUIFactory,
- StringIOWrapper,
- )
from bzrlib.tests.test_progress import _TTYStringIO
-from bzrlib.ui import (
- CLIUIFactory,
- SilentUIFactory,
- )
from bzrlib.ui.text import (
NullProgressView,
TextProgressView,
@@ -45,10 +39,10 @@
)
-class UITests(TestCase):
+class UITests(tests.TestCase):
def test_silent_factory(self):
- ui = SilentUIFactory()
+ ui = _mod_ui.SilentUIFactory()
stdout = StringIO()
self.assertEqual(None,
self.apply_redirected(None, stdout, stdout,
@@ -62,8 +56,9 @@
self.assertEqual('', stdout.getvalue())
def test_text_factory_ascii_password(self):
- ui = TestUIFactory(stdin='secret\n', stdout=StringIOWrapper(),
- stderr=StringIOWrapper())
+ ui = tests.TestUIFactory(stdin='secret\n',
+ stdout=tests.StringIOWrapper(),
+ stderr=tests.StringIOWrapper())
pb = ui.nested_progress_bar()
try:
self.assertEqual('secret',
@@ -84,9 +79,9 @@
We can't predict what encoding users will have for stdin, so we force
it to utf8 to test that we transport the password correctly.
"""
- ui = TestUIFactory(stdin=u'baz\u1234'.encode('utf8'),
- stdout=StringIOWrapper(),
- stderr=StringIOWrapper())
+ ui = tests.TestUIFactory(stdin=u'baz\u1234'.encode('utf8'),
+ stdout=tests.StringIOWrapper(),
+ stderr=tests.StringIOWrapper())
ui.stderr.encoding = ui.stdout.encoding = ui.stdin.encoding = 'utf8'
pb = ui.nested_progress_bar()
try:
@@ -194,11 +189,11 @@
self.assertEqual('', factory.stdin.readline())
def test_silent_ui_getbool(self):
- factory = SilentUIFactory()
+ factory = _mod_ui.SilentUIFactory()
self.assert_get_bool_acceptance_of_user_input(factory)
def test_silent_factory_prompts_silently(self):
- factory = SilentUIFactory()
+ factory = _mod_ui.SilentUIFactory()
stdout = StringIO()
factory.stdin = StringIO("y\n")
self.assertEqual(True,
@@ -222,7 +217,8 @@
def test_text_factory_prompts_and_clears(self):
# a get_boolean call should clear the pb before prompting
out = _TTYStringIO()
- factory = TextUIFactory(stdin=StringIO("yada\ny\n"), stdout=out, stderr=out)
+ factory = TextUIFactory(stdin=StringIO("yada\ny\n"),
+ stdout=out, stderr=out)
pb = factory.nested_progress_bar()
pb.show_bar = False
pb.show_spinner = False
@@ -253,7 +249,7 @@
pb.finished()
def test_silent_ui_getusername(self):
- factory = SilentUIFactory()
+ factory = _mod_ui.SilentUIFactory()
factory.stdin = StringIO("someuser\n\n")
factory.stdout = StringIO()
factory.stderr = StringIO()
@@ -279,8 +275,9 @@
self.assertEqual('', factory.stdin.readline())
def test_text_ui_getusername_utf8(self):
- ui = TestUIFactory(stdin=u'someuser\u1234'.encode('utf8'),
- stdout=StringIOWrapper(), stderr=StringIOWrapper())
+ ui = tests.TestUIFactory(stdin=u'someuser\u1234'.encode('utf8'),
+ stdout=tests.StringIOWrapper(),
+ stderr=tests.StringIOWrapper())
ui.stderr.encoding = ui.stdout.encoding = ui.stdin.encoding = "utf8"
pb = ui.nested_progress_bar()
try:
@@ -295,7 +292,7 @@
pb.finished()
-class TestTextProgressView(TestCase):
+class TestTextProgressView(tests.TestCase):
"""Tests for text display of progress bars.
"""
# XXX: These might be a bit easier to write if the rendering and
More information about the bazaar-commits
mailing list