test_marathon_pod.py 文件源码

python
阅读 26 收藏 0 点赞 0 评论 0

项目:deb-python-dcos 作者: openstack 项目源码 文件源码
def _assert_pod_list_table():
    _wait_for_instances({'/double-pod': 2, '/good-pod': 1, '/winston': 1})
    returncode, stdout, stderr = exec_command(_POD_LIST_CMD)

    assert returncode == 0
    assert stderr == b''

    stdout_lines = stdout.decode('utf-8').split('\n')

    pattern = r'ID\+TASKS +INSTANCES +VERSION +STATUS +STATUS SINCE +WAITING *'
    assert re.fullmatch(pattern, stdout_lines[0])

    assert stdout_lines[1].startswith('/double-pod')
    assert stdout_lines[2].startswith(' |-thing-1')
    assert stdout_lines[3].startswith(' |-thing-2')
    assert stdout_lines[4].startswith('/good-pod')
    assert stdout_lines[5].startswith(' |-good-container')
    assert stdout_lines[6].startswith('/winston')
    assert stdout_lines[7].startswith(' |-the-cat')
    assert stdout_lines[8].startswith(' |-thing-1')
    assert stdout_lines[9].startswith(' |-thing-2')

    assert stdout_lines[10] == ''
    assert len(stdout_lines) == 11
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号