From 42d754825786c60b67638cdcc2bc2edb3fec00b9 Mon Sep 17 00:00:00 2001 From: Victor Morales Date: Thu, 19 Mar 2015 16:46:18 -0600 Subject: [PATCH] Test unit for checking update active images This test unit pretends to cover attempts to upload images with active status. Change-Id: Id557157b30d78af474973a9d385c34aeb8afd0c3 Closes-Bug: #1434306 --- tests/v1/test_shell.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/tests/v1/test_shell.py b/tests/v1/test_shell.py index fb02c39..d088500 100644 --- a/tests/v1/test_shell.py +++ b/tests/v1/test_shell.py @@ -436,6 +436,21 @@ class ShellStdinHandlingTests(testtools.TestCase): or self.collected_args[1]['data'] is None ) + def test_image_update_opened_stdin(self): + """Supply glanceclient with a stdin, and perform an image + update to an active image. Glanceclient should not allow it. + """ + + self.assertRaises( + SystemExit, + v1shell.do_image_update, + self.gc, + argparse.Namespace( + image='96d2c7e1-de4e-4612-8aa2-ba26610c804e', + property={}, + ) + ) + def test_image_update_data_is_read_from_file(self): """Ensure that data is read from a file."""