~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_gpg.py

  • Committer: Ian Clatworthy
  • Date: 2007-12-11 02:07:30 UTC
  • mto: (3119.1.1 ianc-integration)
  • mto: This revision was merged to the branch mainline in revision 3120.
  • Revision ID: ian.clatworthy@internode.on.net-20071211020730-sdj4kj794dw0628e
make help topics more discoverable

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2005, 2006, 2007, 2009, 2011 Canonical Ltd
 
1
# Copyright (C) 2005 Canonical Ltd
2
2
#   Authors: Robert Collins <robert.collins@canonical.com>
3
3
#
4
4
# This program is free software; you can redistribute it and/or modify
13
13
#
14
14
# You should have received a copy of the GNU General Public License
15
15
# along with this program; if not, write to the Free Software
16
 
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
 
16
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
17
17
 
18
18
"""Tests for signing and verifying blobs of data via gpg."""
19
19
 
20
20
# import system imports here
 
21
import os
21
22
import sys
22
23
 
23
24
from bzrlib import errors, ui
24
25
import bzrlib.gpg as gpg
25
 
from bzrlib.tests import TestCase
 
26
from bzrlib.tests import TestCase, TestCaseInTempDir
26
27
 
27
28
class FakeConfig(object):
28
29
 
29
30
    def gpg_signing_command(self):
30
31
        return "false"
31
 
 
 
32
        
32
33
 
33
34
class TestCommandLine(TestCase):
34
35
 
49
50
        if sys.platform == 'win32':
50
51
            # Windows doesn't come with cat, and we don't require it
51
52
            # so lets try using python instead.
52
 
            # But stupid windows and line-ending conversions.
 
53
            # But stupid windows and line-ending conversions. 
53
54
            # It is too much work to make sys.stdout be in binary mode.
54
55
            # http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/65443
55
56
            my_gpg._command_line = lambda:[sys.executable, '-c',
68
69
    def test_clears_progress(self):
69
70
        content = "some content\nwith newlines\n"
70
71
        old_clear_term = ui.ui_factory.clear_term
71
 
        clear_term_called = []
 
72
        clear_term_called = [] 
72
73
        def clear_term():
73
74
            old_clear_term()
74
75
            clear_term_called.append(True)