diff options
author | Steve Baker <sbaker@redhat.com> | 2022-03-01 13:42:54 +1300 |
---|---|---|
committer | Steve Baker <sbaker@redhat.com> | 2022-03-07 09:34:26 +1300 |
commit | c61bf1bce8c4bb450ff3342fc65fc403655a4160 (patch) | |
tree | 9319083e7988ee6f3476c308d5c2f3875403a7d0 | |
parent | 7a776462ccbf2b8eae4c7bd8de754ce081d96cd5 (diff) | |
download | python-ironicclient-c61bf1bce8c4bb450ff3342fc65fc403655a4160.tar.gz |
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
(cherry picked from commit 59df415bbf66296fcc4a9abcfca6c764b7538e21)
-rw-r--r-- | ironicclient/tests/unit/common/test_utils.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/ironicclient/tests/unit/common/test_utils.py b/ironicclient/tests/unit/common/test_utils.py index 8bf06a5..a3c9972 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) |