Merge lp:~rvb/maas-test/fix-error-reporting into lp:maas-test

Proposed by Raphaël Badin
Status: Merged
Approved by: Raphaël Badin
Approved revision: 95
Merged at revision: 95
Proposed branch: lp:~rvb/maas-test/fix-error-reporting
Merge into: lp:maas-test
Diff against target: 59 lines (+9/-11)
2 files modified
maastest/kvmfixture.py (+4/-3)
maastest/tests/test_kvmfixture.py (+5/-8)
To merge this branch: bzr merge lp:~rvb/maas-test/fix-error-reporting
Reviewer Review Type Date Requested Status
Gavin Panella (community) Approve
Review via email: mp+198736@code.launchpad.net

Commit message

Use text_content instead of binary_content with addDetail.

To post a comment you must log in.
Revision history for this message
Gavin Panella (allenap) :
review: Approve
Revision history for this message
MAAS Lander (maas-lander) wrote :
Download full text (29.9 KiB)

The attempt to merge lp:~rvb/maas-test/fix-error-reporting into lp:maas-test failed. Below is the output from the failed tests.

Ign http://security.ubuntu.com saucy-security InRelease
Ign http://nova.clouds.archive.ubuntu.com saucy InRelease
Get:1 http://security.ubuntu.com saucy-security Release.gpg [933 B]
Ign http://nova.clouds.archive.ubuntu.com saucy-updates InRelease
Get:2 http://security.ubuntu.com saucy-security Release [49.6 kB]
Hit http://nova.clouds.archive.ubuntu.com saucy Release.gpg
Get:3 http://nova.clouds.archive.ubuntu.com saucy-updates Release.gpg [933 B]
Hit http://nova.clouds.archive.ubuntu.com saucy Release
Get:4 http://nova.clouds.archive.ubuntu.com saucy-updates Release [49.6 kB]
Hit http://nova.clouds.archive.ubuntu.com saucy/main Sources
Hit http://nova.clouds.archive.ubuntu.com saucy/universe Sources
Hit http://nova.clouds.archive.ubuntu.com saucy/main amd64 Packages
Hit http://nova.clouds.archive.ubuntu.com saucy/universe amd64 Packages
Hit http://nova.clouds.archive.ubuntu.com saucy/main Translation-en
Hit http://nova.clouds.archive.ubuntu.com saucy/universe Translation-en
Get:5 http://security.ubuntu.com saucy-security/main Sources [15.6 kB]
Get:6 http://security.ubuntu.com saucy-security/universe Sources [6,663 B]
Get:7 http://security.ubuntu.com saucy-security/main amd64 Packages [46.0 kB]
Get:8 http://security.ubuntu.com saucy-security/universe amd64 Packages [18.1 kB]
Hit http://security.ubuntu.com saucy-security/main Translation-en
Hit http://security.ubuntu.com saucy-security/universe Translation-en
Ign http://security.ubuntu.com saucy-security/main Translation-en_US
Get:9 http://nova.clouds.archive.ubuntu.com saucy-updates/main Sources [51.8 kB]
Get:10 http://nova.clouds.archive.ubuntu.com saucy-updates/universe Sources [19.1 kB]
Get:11 http://nova.clouds.archive.ubuntu.com saucy-updates/main amd64 Packages [151 kB]
Ign http://security.ubuntu.com saucy-security/universe Translation-en_US
Get:12 http://nova.clouds.archive.ubuntu.com saucy-updates/universe amd64 Packages [59.7 kB]
Get:13 http://nova.clouds.archive.ubuntu.com saucy-updates/main Translation-en [67.8 kB]
Get:14 http://nova.clouds.archive.ubuntu.com saucy-updates/universe Translation-en [33.9 kB]
Ign http://nova.clouds.archive.ubuntu.com saucy/main Translation-en_US
Ign http://nova.clouds.archive.ubuntu.com saucy/universe Translation-en_US
Ign http://nova.clouds.archive.ubuntu.com saucy-updates/main Translation-en_US
Ign http://nova.clouds.archive.ubuntu.com saucy-updates/universe Translation-en_US
Fetched 571 kB in 0s (2,439 kB/s)
Reading package lists...
Reading package lists...
Building dependency tree...
Reading state information...
cpu-checker is already the newest version.
python-distro-info is already the newest version.
python-fixtures is already the newest version.
python-lxml is already the newest version.
python-mock is already the newest version.
python-netaddr is already the newest version.
python-netifaces is already the newest version.
python-six is already the newest version.
python-testresources is already the newest version.
python-testtools is already the newest version.
python-xdg is already the newest version.
python3-fixtur...

95. By Raphaël Badin

Fix tests.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'maastest/kvmfixture.py'
2--- maastest/kvmfixture.py 2013-12-10 14:09:16 +0000
3+++ maastest/kvmfixture.py 2013-12-12 16:46:49 +0000
4@@ -26,7 +26,6 @@
5 from fixtures import Fixture
6 from lxml import etree
7 from maastest.utils import (
8- binary_content,
9 extract_mac_ip_mapping,
10 retries,
11 run_command,
12@@ -372,8 +371,10 @@
13 self.addDetail(cmd_prefix + ' retcode', text_content(str(retcode)))
14 input_detail = '' if input is None else input
15 self.addDetail(cmd_prefix + ' input', text_content(input_detail))
16- self.addDetail(cmd_prefix + ' stdout', binary_content(stdout))
17- self.addDetail(cmd_prefix + ' stderr', binary_content(stderr))
18+ u_stdout = unicode(stdout, errors='replace')
19+ self.addDetail(cmd_prefix + ' stdout', text_content(u_stdout))
20+ u_stderr = unicode(stderr, errors='replace')
21+ self.addDetail(cmd_prefix + ' stderr', text_content(u_stderr))
22 return retcode, stdout, stderr
23
24 def get_ip_from_network_scan(self, mac_address):
25
26=== modified file 'maastest/tests/test_kvmfixture.py'
27--- maastest/tests/test_kvmfixture.py 2013-12-10 14:09:42 +0000
28+++ maastest/tests/test_kvmfixture.py 2013-12-12 16:46:49 +0000
29@@ -20,10 +20,7 @@
30 import fixtures
31 from lxml import etree
32 from maastest import kvmfixture
33-from maastest.utils import (
34- binary_content,
35- read_file,
36- )
37+from maastest.utils import read_file
38 import mock
39 import netaddr
40 from six import text_type
41@@ -590,14 +587,14 @@
42 (
43 text_type(return_value),
44 input,
45- binary_content(stdout_content),
46- binary_content(stderr_content),
47+ stdout_content,
48+ stderr_content,
49 ),
50 (
51 details['cmd #0001 retcode'].as_text(),
52 details['cmd #0001 input'].as_text(),
53- details['cmd #0001 stdout'],
54- details['cmd #0001 stderr'],
55+ details['cmd #0001 stdout'].as_text(),
56+ details['cmd #0001 stderr'].as_text(),
57 ))
58
59 def test_get_ip_from_network_scan(self):

Subscribers

People subscribed via source and target branches