From 59df415bbf66296fcc4a9abcfca6c764b7538e21 Mon Sep 17 00:00:00 2001 From: Steve Baker Date: Tue, 1 Mar 2022 13:42:54 +1300 Subject: [PATCH] Avoid using 'foo' as invalid JSON test data Downstream test environments appear to have a file called 'foo' either created out-of-band, or created by tests executed in a non-deterministic order. This changes the test data to very invalid json which is unlikely to be a filename, ensuring the expected codepath is tested. Change-Id: I88ed81337c6e2d724b3cf4ddf90e0d60fa052d1c --- ironicclient/tests/unit/common/test_utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ironicclient/tests/unit/common/test_utils.py b/ironicclient/tests/unit/common/test_utils.py index 8bf06a5b4..a3c9972ce 100644 --- a/ironicclient/tests/unit/common/test_utils.py +++ b/ironicclient/tests/unit/common/test_utils.py @@ -377,7 +377,7 @@ class HandleJsonFileTest(test_utils.BaseTestCase): self.assertEqual(json.loads(cleansteps), steps) def test_handle_json_or_file_arg_bad_json(self): - cleansteps = 'foo' + cleansteps = '{foo invalid: json{' self.assertRaisesRegex(exc.InvalidAttribute, 'is not a file and cannot be parsed as JSON', utils.handle_json_or_file_arg, cleansteps)