Ejemplo n.º 1
0
def test_format_table():
    res = format_table(['fruit', 'color'], [('apple', 'red'),
                                            ('banana', 'yellow'),
                                            ('tomato', 'red'),
                                            ('pear', 'green')])
    sol = ('FRUIT     COLOR\n'
           'apple     red\n'
           'banana    yellow\n'
           'tomato    red\n'
           'pear      green')
    assert res == sol
    assert format_table(['fruit', 'color'], []) == 'FRUIT    COLOR'
Ejemplo n.º 2
0
def status(app_id):
    report = _get_skein_client().application_report(app_id)
    header = [
        'application_id', 'name', 'state', 'status', 'containers', 'vcores',
        'memory', 'runtime'
    ]
    data = [(report.id, report.name, report.state, report.final_status,
             report.usage.num_used_containers,
             report.usage.used_resources.vcores,
             report.usage.used_resources.memory,
             humanize_timedelta(report.runtime))]
    print(format_table(header, data))
Ejemplo n.º 3
0
def status(app_id):
    report = _get_skein_client().application_report(app_id)
    header = [
        "application_id",
        "name",
        "state",
        "status",
        "containers",
        "vcores",
        "memory",
        "runtime",
    ]
    data = [(
        report.id,
        report.name,
        report.state,
        report.final_status,
        report.usage.num_used_containers,
        report.usage.used_resources.vcores,
        report.usage.used_resources.memory,
        humanize_timedelta(report.runtime),
    )]
    print(format_table(header, data))