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