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