Merge ~smoser/curtin:fix/no-use-assert-called into curtin:master

Proposed by Scott Moser
Status: Merged
Approved by: Scott Moser
Approved revision: f39007a27555be5a1c8c0ceb1130cffe23bb70ac
Merge reported by: Scott Moser
Merged at revision: ae48e86fb0289738c71111000d587fcade7fdc66
Proposed branch: ~smoser/curtin:fix/no-use-assert-called
Merge into: curtin:master
Diff against target: 13 lines (+1/-1)
1 file modified
tests/unittests/test_commands_block_meta.py (+1/-1)
Reviewer Review Type Date Requested Status
Server Team CI bot continuous-integration Approve
Ryan Harper (community) Approve
Review via email: mp+345945@code.launchpad.net

Commit message

tests: replace usage of mock.assert_called

assert_called is only in mock 2 or newer, meaning this was failing
to run tests in a xenial build environment.

So just replace assert_called usage with assertTrue(mymock.called).

Description of the change

see commit message

To post a comment you must log in.
Revision history for this message
Ryan Harper (raharper) wrote :

Good fix.

review: Approve
Revision history for this message
Server Team CI bot (server-team-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
Scott Moser (smoser) wrote :

An upstream commit landed for this bug.

To view that commit see the following URL:
https://git.launchpad.net/curtin/commit/?id=ae48e86f

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/tests/unittests/test_commands_block_meta.py b/tests/unittests/test_commands_block_meta.py
2index 17186d4..a6a0b13 100644
3--- a/tests/unittests/test_commands_block_meta.py
4+++ b/tests/unittests/test_commands_block_meta.py
5@@ -680,7 +680,7 @@ class TestFstabData(CiTestCase):
6 call(['mount', "-t", "ext4", "-o", "defaults",
7 "/dev/disk1", "/mnt"], capture=True),
8 m_subp.call_args)
9- m_ensure_dir.assert_called()
10+ self.assertTrue(m_ensure_dir.called)
11
12 def _check_mount_fstab_subp(self, fdata, expected, target=None):
13 # expected currently is like: mount <device> <mp>

Subscribers

People subscribed via source and target branches