We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ce901f3 commit 25f5c73Copy full SHA for 25f5c73
1 file changed
kubernetes/base/config/kube_config_test.py
@@ -267,6 +267,26 @@ def test_file_given_no_object_data(self):
267
data_key_name=TEST_DATA_KEY)
268
self.assertEqual(t.as_data(), None)
269
270
+ def test_file_recreation(self):
271
+ obj = {TEST_DATA_KEY: TEST_DATA_BASE64}
272
+ t1 = FileOrData(
273
+ obj=obj,
274
+ file_key_name=TEST_FILE_KEY,
275
+ data_key_name=TEST_DATA_KEY,
276
+ )
277
+ first_file_path = t1.as_file()
278
+ # We manually remove the file from the disk leaving it in the cache
279
+ os.remove(first_file_path)
280
+
281
+ t2 = FileOrData(
282
283
284
285
286
287
+ second_file_path = t2.as_file()
288
+ self.assertEqual(TEST_DATA, self.get_file_content(second_file_path))
289
290
291
class TestConfigNode(BaseTestCase):
292
0 commit comments