Merge lp:~rvb/maas-test/fix-proxy-usage into lp:maas-test
Proposed by
Raphaël Badin
Status: | Merged |
---|---|
Merged at revision: | 71 |
Proposed branch: | lp:~rvb/maas-test/fix-proxy-usage |
Merge into: | lp:maas-test |
Diff against target: |
130 lines (+68/-5) 2 files modified
maastest/maasfixture.py (+14/-5) maastest/tests/test_maasfixture.py (+54/-0) |
To merge this branch: | bzr merge lp:~rvb/maas-test/fix-proxy-usage |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Gavin Panella (community) | Approve | ||
Review via email: mp+196745@code.launchpad.net |
Commit message
This branch uses the proxy URL in maasfixture: if it is defined, MAAS' http_proxy option is set.
Drive-by fix: add a unit test for configure_
To post a comment you must log in.
Looks good.
[1]
- def configure_ default_ series( self, series): maas(self, name, value):
- """Set the default series used for enlistment and commissioning."""
+ def configure_
+ """Set a config value in MAAS."""
The name "configure_maas" is somewhat tautological. The full name of maasfixture. MAASFixture. configure_ maas. I
this function is: maastest.
think it's safe to call it just "configure".
[2]
if response.code != httplib.OK:
# TODO: include the response's content in the exception
# message, here and in other places in this file.
- raise Exception("Error configuring the commissiong series")
+ raise Exception("Error configuring '%s'" % name)
As discussed in a previous branch, we really need to do something about
this. It's hiding what might be very useful information that could save
hours of debugging.
[3]
+ self.patch( maas_fixture, 'admin_ maas_client' , mock.MagicMock()) tring() MAASClient( admin_maas_ client, 'post', '')
+ series = self.getUniqueS
+ call_mock = self.patch_
+ maas_fixture.
Do you need the first line here?
[4]
+ self.assertEqual( ning_distro_ series' , value=series)], mock_calls) )
+ [mock.call(
+ '/api/1.0/maas/', op='set_config',
+ name='commissio
+ (call_mock.
The braces in the last line are superflous, though harmless.