Fix for mock API change, bump setup.cfg version to 2015.2

Also, fix a unit test that is failing with newer versions of mock,
which apparently changed the API around assert_has_calls()

Change-Id: Icf7f159fb37783a38a33759963f04f50ec05e262
Depends-on: Ide474eb90acf0d07a807c401173b1f14f351f1c9
This commit is contained in:
Adam Gandelman 2015-07-30 19:55:54 -07:00
parent b8aeb53745
commit 7a077881c9
2 changed files with 4 additions and 7 deletions

View File

@ -1,6 +1,6 @@
[metadata] [metadata]
name = akanda-appliance name = akanda-appliance
version = 2015.1 version = 2015.2
summary = Akanda Linux-based L3 software router summary = Akanda Linux-based L3 software router
description-file = description-file =
README.md README.md

View File

@ -46,16 +46,13 @@ class HostnameTestCase(TestCase):
]) ])
def test_update_hosts(self): def test_update_hosts(self):
expected = [ expected = mock.call('/tmp/hosts', '\n'.join([
'127.0.0.1 localhost', '127.0.0.1 localhost',
'::1 localhost ip6-localhost ip6-loopback', '::1 localhost ip6-localhost ip6-loopback',
'fdca:3ba5:a17a:acda:f816:3eff:fe66:33b6 akanda' 'fdca:3ba5:a17a:acda:f816:3eff:fe66:33b6 akanda'
] ]))
self.mgr.update_hosts(CONFIG) self.mgr.update_hosts(CONFIG)
self.mock_execute.assert_has_calls([ self.mock_execute.assert_has_calls([
mock.call(['mv', '/tmp/hosts', '/etc/hosts'], 'sudo') mock.call(['mv', '/tmp/hosts', '/etc/hosts'], 'sudo')
]) ])
self.mock_replace_file.assert_has_calls(mock.call( self.mock_replace_file.assert_has_calls([expected])
'/tmp/hosts',
'\n'.join(expected))
)