2 # Copyright (c) 2012 The Chromium OS Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file.
6 """This module tests the cros image command."""
8 from __future__ import print_function
14 sys.path.insert(0, os.path.abspath('%s/../../..' % os.path.dirname(__file__)))
15 from chromite.cros.commands import cros_image
16 from chromite.lib import cros_test_lib
19 class ImageCommandTest(cros_test_lib.TestCase):
20 """Test class for our ImageCommand class."""
23 """Tests that our example parser works as expected."""
24 fake_parser = argparse.ArgumentParser()
25 fake_subparser = fake_parser.add_subparsers()
26 image_parser = fake_subparser.add_parser('image')
27 cros_image.ImageCommand.AddParser(image_parser)
29 options = fake_parser.parse_args(['image', '--myoption=awesome'])
30 instance = options.cros_class(options)
31 self.assertEqual(instance.options.myoption, 'awesome')
34 if __name__ == '__main__':