def test_instantiating_right_2():
    set_keyboard_input(['test_2', 'Raj Dholakia'])
    path = Path.cwd() / 'tests'
    pb = ProjectBuilder(path=str(path))
    assert pb.path == path
def test_instantiating_error_2():
    set_keyboard_input(['endswith-',  # Ends with '-'
                        'One space',  # Contains white space.
                        '_incorrect'])  # Start with '_'
    with pytest.raises(UserWarning):
        ProjectBuilder()
def test_instantiating_error_1():
    set_keyboard_input(['-test_1',  # Start with '-'
                        '$Te*st=2',  # Contains illegal special charaters.
                        'next&warning'])  # Contains one illegal character.
    with pytest.raises(UserWarning):
        ProjectBuilder()
def test_instantiating_path_error_2():
    path = Path.cwd() / 'test.txt'
    path.touch()
    with pytest.raises(TypeError):
        ProjectBuilder(path)
    path.unlink()
def test_instantiating_path_error_1():
    path = Path.cwd() / 'non_existant'
    with pytest.raises(FileNotFoundError):
        ProjectBuilder(path)
def pb():
    set_keyboard_input(['test', 'RaDroid'])
    pb = ProjectBuilder()
    yield pb
    if pb.proj_dir is not None and pb.proj_dir.exists():
        rmtree(pb.proj_dir)