diff options
author | Steve Baker <sbaker@redhat.com> | 2022-03-01 13:42:54 +1300 |
---|---|---|
committer | Steve Baker <sbaker@redhat.com> | 2022-03-01 13:42:54 +1300 |
commit | 59df415bbf66296fcc4a9abcfca6c764b7538e21 (patch) | |
tree | bcbd637efa9b2e0cbf6974afd430e271d3feec22 | |
parent | 4126936c4b3cea6100c6360c40f9118461c0d3dc (diff) | |
download | python-ironicclient-59df415bbf66296fcc4a9abcfca6c764b7538e21.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
-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) |