/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to breezy/tests/blackbox/test_script.py

  • Committer: Breezy landing bot
  • Author(s): Colin Watson
  • Date: 2020-11-16 21:47:08 UTC
  • mfrom: (7521.1.1 remove-lp-workaround)
  • Revision ID: breezy.the.bot@gmail.com-20201116214708-jos209mgxi41oy15
Remove breezy.git workaround for bazaar.launchpad.net.

Merged from https://code.launchpad.net/~cjwatson/brz/remove-lp-workaround/+merge/393710

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2010 Canonical Ltd
 
1
# Copyright (C) 2010, 2016 Canonical Ltd
2
2
#
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
18
18
 
19
19
import os
20
20
 
21
 
from bzrlib import (
 
21
from breezy import (
22
22
    tests,
23
23
    )
24
 
from bzrlib.tests import (
 
24
from breezy.tests import (
25
25
    script,
26
26
    )
27
27
 
32
32
        self.run_bzr(['test-script', 'I-do-not-exist'], retcode=3)
33
33
 
34
34
    def test_empty_file(self):
35
 
        self.build_tree_contents([('script', '')])
 
35
        self.build_tree_contents([('script', b'')])
36
36
        out, err = self.run_bzr(['test-script', 'script'])
37
37
        out_lines = out.splitlines()
38
38
        self.assertStartsWith(out_lines[-3], 'Ran 1 test in ')
39
 
        self.assertEquals('OK', out_lines[-1])
40
 
        self.assertEquals('', err)
 
39
        self.assertEqual('OK', out_lines[-1])
 
40
        self.assertEqual('', err)
41
41
 
42
42
    def test_simple_file(self):
43
 
        self.build_tree_contents([('script', '''
 
43
        self.build_tree_contents([('script', b'''
44
44
$ echo hello world
45
45
hello world
46
46
''')])
47
47
        out, err = self.run_bzr(['test-script', 'script'])
48
48
        out_lines = out.splitlines()
49
49
        self.assertStartsWith(out_lines[-3], 'Ran 1 test in ')
50
 
        self.assertEquals('OK', out_lines[-1])
51
 
        self.assertEquals('', err)
 
50
        self.assertEqual('OK', out_lines[-1])
 
51
        self.assertEqual('', err)
52
52
 
53
53
    def test_null_output(self):
54
 
        self.build_tree_contents([('script', '''
 
54
        self.build_tree_contents([('script', b'''
55
55
$ echo hello world
56
56
''')])
57
57
        out, err = self.run_bzr(['test-script', 'script', '--null-output'])
58
58
        out_lines = out.splitlines()
59
59
        self.assertStartsWith(out_lines[-3], 'Ran 1 test in ')
60
 
        self.assertEquals('OK', out_lines[-1])
61
 
        self.assertEquals('', err)
 
60
        self.assertEqual('OK', out_lines[-1])
 
61
        self.assertEqual('', err)
62
62
 
63
63
    def test_failing_script(self):
64
 
        self.build_tree_contents([('script', '''
 
64
        self.build_tree_contents([('script', b'''
65
65
$ echo hello foo
66
66
hello bar
67
67
''')])
68
68
        out, err = self.run_bzr(['test-script', 'script'], retcode=1)
69
69
        out_lines = out.splitlines()
70
70
        self.assertStartsWith(out_lines[-3], 'Ran 1 test in ')
71
 
        self.assertEquals('FAILED (failures=1)', out_lines[-1])
72
 
        self.assertEquals('', err)
 
71
        self.assertEqual('FAILED (failures=1)', out_lines[-1])
 
72
        self.assertEqual('', err)