예제 #1
0
def test_noop():
    """Ensure docopt exit (displays usage)
    """
    with pytest.raises(DocoptExit):
        main([])
    with pytest.raises(DocoptExit):
        main(['foobar'])
예제 #2
0
파일: test_cli.py 프로젝트: unterstein/dcos
def test_missing_input(tmpdir):
    """No files are provided so any operation should fail
    """
    with tmpdir.as_cwd():
        for cmd in ['create', 'wait', 'describe', 'delete', 'pytest']:
            with pytest.raises(FileNotFoundError):
                main([cmd])
예제 #3
0
파일: test_cli.py 프로젝트: malnick/dcos
def test_noop():
    """Ensure docopt exit (displays usage)
    """
    with pytest.raises(DocoptExit):
        main([])
    with pytest.raises(DocoptExit):
        main(['foobar'])
예제 #4
0
def test_conflicting_path(tmpdir, aws_cf_config_path):
    """Ensure default cluster info path is never overwritten
    by launching successive clusters
    """
    with tmpdir.as_cwd():
        shutil.copyfile(aws_cf_config_path, str(tmpdir.join('config.yaml')))
        assert main(['create']) == 0
        assert main(['create']) == 1
예제 #5
0
파일: test_cli.py 프로젝트: malnick/dcos
def test_conflicting_path(tmpdir, aws_cf_config_path):
    """Ensure default cluster info path is never overwritten
    by launching successive clusters
    """
    with tmpdir.as_cwd():
        shutil.copyfile(aws_cf_config_path, str(tmpdir.join('config.yaml')))
        assert main(['create']) == 0
        assert main(['create']) == 1
예제 #6
0
def test_no_files_specified(tmpdir, aws_cf_config_path):
    """Ensure typical usage works without specifying config and info file paths
    """
    with tmpdir.as_cwd():
        shutil.copyfile(aws_cf_config_path, str(tmpdir.join('config.yaml')))
        assert main(['create']) == 0
        assert main(['wait']) == 0
        assert main(['describe']) == 0
        assert main(['pytest']) == 0
        assert main(['delete']) == 0
예제 #7
0
파일: test_cli.py 프로젝트: malnick/dcos
def test_no_files_specified(tmpdir, aws_cf_config_path):
    """Ensure typical usage works without specifying config and info file paths
    """
    with tmpdir.as_cwd():
        shutil.copyfile(aws_cf_config_path, str(tmpdir.join('config.yaml')))
        assert main(['create']) == 0
        assert main(['wait']) == 0
        assert main(['describe']) == 0
        assert main(['pytest']) == 0
        assert main(['delete']) == 0
예제 #8
0
def test_missing_input(tmpdir):
    """No files are provided so any operation should fail
    """
    with tmpdir.as_cwd():
        for cmd in ['create', 'wait', 'describe', 'delete', 'pytest']:
            assert main([cmd]) == 1