Statistics
| Branch: | Tag: | Revision:

root / kamaki / cli / commands / test_cli.py @ af6de846

History | View | Annotate | Download (2.2 kB)

1 33e3437a Stavros Sachtouris
# Copyright 2012-2013 GRNET S.A. All rights reserved.
2 33e3437a Stavros Sachtouris
#
3 33e3437a Stavros Sachtouris
# Redistribution and use in source and binary forms, with or
4 33e3437a Stavros Sachtouris
# without modification, are permitted provided that the following
5 33e3437a Stavros Sachtouris
# conditions are met:
6 33e3437a Stavros Sachtouris
#
7 33e3437a Stavros Sachtouris
#   1. Redistributions of source code must retain the above
8 33e3437a Stavros Sachtouris
#      copyright notice, this list of conditions and the following
9 33e3437a Stavros Sachtouris
#      disclaimer.
10 33e3437a Stavros Sachtouris
#
11 33e3437a Stavros Sachtouris
#   2. Redistributions in binary form must reproduce the above
12 33e3437a Stavros Sachtouris
#      copyright notice, this list of conditions and the following
13 33e3437a Stavros Sachtouris
#      disclaimer in the documentation and/or other materials
14 33e3437a Stavros Sachtouris
#      provided with the distribution.
15 33e3437a Stavros Sachtouris
#
16 33e3437a Stavros Sachtouris
# THIS SOFTWARE IS PROVIDED BY GRNET S.A. ``AS IS'' AND ANY EXPRESS
17 33e3437a Stavros Sachtouris
# OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 33e3437a Stavros Sachtouris
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
19 33e3437a Stavros Sachtouris
# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GRNET S.A OR
20 33e3437a Stavros Sachtouris
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
21 33e3437a Stavros Sachtouris
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22 33e3437a Stavros Sachtouris
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
23 33e3437a Stavros Sachtouris
# USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
24 33e3437a Stavros Sachtouris
# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25 33e3437a Stavros Sachtouris
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
26 33e3437a Stavros Sachtouris
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
27 33e3437a Stavros Sachtouris
# POSSIBILITY OF SUCH DAMAGE.
28 33e3437a Stavros Sachtouris
#
29 33e3437a Stavros Sachtouris
# The views and conclusions contained in the software and
30 33e3437a Stavros Sachtouris
# documentation are those of the authors and should not be
31 33e3437a Stavros Sachtouris
# interpreted as representing official policies, either expressed
32 33e3437a Stavros Sachtouris
# or implied, of GRNET S.A.command
33 33e3437a Stavros Sachtouris
34 33e3437a Stavros Sachtouris
from kamaki.cli import command
35 03fd7ddb Stavros Sachtouris
from kamaki.cli.commands import _command_init
36 af6de846 Stavros Sachtouris
from kamaki.cli.command_tree import CommandTree
37 33e3437a Stavros Sachtouris
38 234954d1 Stavros Sachtouris
39 af6de846 Stavros Sachtouris
API_DESCRIPTION = dict(test='Test sample')
40 234954d1 Stavros Sachtouris
41 af6de846 Stavros Sachtouris
_commands = CommandTree('test', 'Test sample')
42 234954d1 Stavros Sachtouris
43 af6de846 Stavros Sachtouris
44 af6de846 Stavros Sachtouris
class _test_init(_command_init):
45 af6de846 Stavros Sachtouris
    def main(self, *args, **kwargs):
46 d07b3796 Stavros Sachtouris
        print(self.__class__)
47 234954d1 Stavros Sachtouris
48 af6de846 Stavros Sachtouris
49 c59aef27 Stavros Sachtouris
@command()
50 af6de846 Stavros Sachtouris
class test_cmd0(_test_init):
51 af6de846 Stavros Sachtouris
    """ test cmd"""
52 c59aef27 Stavros Sachtouris
53 af6de846 Stavros Sachtouris
    def main(self, mant):
54 c59aef27 Stavros Sachtouris
        super(self.__class__, self).main()
55 c59aef27 Stavros Sachtouris
56 c59aef27 Stavros Sachtouris
@command()
57 af6de846 Stavros Sachtouris
class test_cmd_all(_test_init):
58 af6de846 Stavros Sachtouris
    """test cmd all"""
59 c59aef27 Stavros Sachtouris
60 c59aef27 Stavros Sachtouris
    def main(self):
61 c59aef27 Stavros Sachtouris
        super(self.__class__, self).main()
62 33e3437a Stavros Sachtouris
63 33e3437a Stavros Sachtouris
@command()
64 af6de846 Stavros Sachtouris
class test_cmd_some(_test_init):
65 af6de846 Stavros Sachtouris
    """test_cmd_some"""
66 33e3437a Stavros Sachtouris
67 af6de846 Stavros Sachtouris
    def main(self, opt='lala'):
68 234954d1 Stavros Sachtouris
        super(self.__class__, self).main()