assertTrue(mock.called) -> mock.assert_called 11/53111/1
authorEmma Foley <emma.l.foley@intel.com>
Mon, 5 Mar 2018 17:41:33 +0000 (17:41 +0000)
committerEmma Foley <emma.l.foley@intel.com>
Mon, 5 Mar 2018 17:41:33 +0000 (17:41 +0000)
commit3478059d4397c5ee3a1d1e4707c5883afd0974a8
tree2c2d5c68c3f2a6232ab0b71e00e07184ded9926f
parent8400c1895c49cb0c7802692f75d820fb5b8b7dc4
assertTrue(mock.called) -> mock.assert_called

When checking whether a mocked method has been called,
mock.assert_called or mock.assert_called_once should be
used, and not unittest.assertTrue(mock.called)

This change does this update.
It can be verified with:
  grep -irn "self.assertTrue(.*called)" --exclude-dir=.tox
And the replacement was done with:
  sed -i 's/self.assertTrue(\(.*\).called)/\1.assert_called_once()/g' <list_of_files>

Change-Id: I4f26e0c736bf33e0b2413c8e8c33dbdb91f090e2
JIRA: YARDSTICK-865
Signed-off-by: Emma Foley <emma.l.foley@intel.com>
33 files changed:
yardstick/tests/unit/benchmark/contexts/test_heat.py
yardstick/tests/unit/benchmark/contexts/test_kubernetes.py
yardstick/tests/unit/benchmark/contexts/test_node.py
yardstick/tests/unit/benchmark/core/test_task.py
yardstick/tests/unit/benchmark/scenarios/lib/test_add_memory_load.py
yardstick/tests/unit/benchmark/scenarios/lib/test_attach_volume.py
yardstick/tests/unit/benchmark/scenarios/lib/test_check_numa_info.py
yardstick/tests/unit/benchmark/scenarios/lib/test_create_flavor.py
yardstick/tests/unit/benchmark/scenarios/lib/test_create_network.py
yardstick/tests/unit/benchmark/scenarios/lib/test_create_port.py
yardstick/tests/unit/benchmark/scenarios/lib/test_create_router.py
yardstick/tests/unit/benchmark/scenarios/lib/test_create_sec_group.py
yardstick/tests/unit/benchmark/scenarios/lib/test_create_server.py
yardstick/tests/unit/benchmark/scenarios/lib/test_create_subnet.py
yardstick/tests/unit/benchmark/scenarios/lib/test_create_volume.py
yardstick/tests/unit/benchmark/scenarios/lib/test_delete_flavor.py
yardstick/tests/unit/benchmark/scenarios/lib/test_delete_floating_ip.py
yardstick/tests/unit/benchmark/scenarios/lib/test_delete_image.py
yardstick/tests/unit/benchmark/scenarios/lib/test_delete_keypair.py
yardstick/tests/unit/benchmark/scenarios/lib/test_delete_port.py
yardstick/tests/unit/benchmark/scenarios/lib/test_delete_router.py
yardstick/tests/unit/benchmark/scenarios/lib/test_delete_router_gateway.py
yardstick/tests/unit/benchmark/scenarios/lib/test_delete_router_interface.py
yardstick/tests/unit/benchmark/scenarios/lib/test_delete_server.py
yardstick/tests/unit/benchmark/scenarios/lib/test_delete_volume.py
yardstick/tests/unit/benchmark/scenarios/lib/test_detach_volume.py
yardstick/tests/unit/benchmark/scenarios/lib/test_get_flavor.py
yardstick/tests/unit/benchmark/scenarios/lib/test_get_migrate_target_host.py
yardstick/tests/unit/benchmark/scenarios/lib/test_get_numa_info.py
yardstick/tests/unit/benchmark/scenarios/lib/test_get_server.py
yardstick/tests/unit/benchmark/scenarios/networking/test_iperf3.py
yardstick/tests/unit/test_cmd/commands/test_env.py
yardstick/tests/unit/test_cmd/commands/test_testcase.py