~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_gpg.py

  • Committer: John Arbash Meinel
  • Date: 2006-02-15 15:18:44 UTC
  • mto: (1185.79.1 bzr-jam-pending)
  • mto: This revision was merged to the branch mainline in revision 1554.
  • Revision ID: john@arbash-meinel.com-20060215151844-ce3e3efccd19da3f
Reverting gpg changes, should not be mainline, see gpg_uses_tempfile plugin.

Show diffs side-by-side

added added

removed removed

Lines of Context:
35
35
 
36
36
    def test_signing_command_line(self):
37
37
        my_gpg = gpg.GPGStrategy(FakeConfig())
38
 
        self.assertEqual(['false',  '--output', '-', '--clearsign'],
 
38
        self.assertEqual(['false',  '--clearsign'],
39
39
                         my_gpg._command_line())
40
40
 
41
41
    def test_checks_return_code(self):
56
56
            # It is too much work to make sys.stdout be in binary mode.
57
57
            # http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/65443
58
58
            my_gpg._command_line = lambda:[sys.executable, '-c',
59
 
                    'import sys; sys.stdout.write(open(sys.argv[-1].read()))']
 
59
                    'import sys; sys.stdout.write(sys.stdin.read())']
60
60
            new_content = content.replace('\n', '\r\n')
61
61
 
62
62
            self.assertEqual(new_content, my_gpg.sign(content))
63
63
        else:
64
 
            my_gpg._command_line = lambda:['cat']
 
64
            my_gpg._command_line = lambda:['cat', '-']
65
65
            self.assertEqual(content, my_gpg.sign(content))
66
66
 
67
67