def test_command_doctor(capfd):
    path_config = get_config_path(name = NAME)
    path_db     = osp.join(path_config, "db.db")
    
    assert osp.exists(path_db)
    command(verbose = True, doctor = True, clean = True)
    assert not osp.exists(path_db)
def test_command_self(capfd):
    command(verbose = True, self = True, pip = True)
    out, err  = capfd.readouterr()
    sanitized = strip_ansi(out)

    # assert "pip upto date." in sanitized
    assert "pipupgrade upto date." in sanitized
def test_command_file(capfd):
    with make_temp_dir() as tmp_dir:
        log_file = osp.join(tmp_dir, "logs.txt")
        
        assert not osp.exists(log_file)
        command(verbose = True, output = log_file, self = True)
        assert osp.exists(log_file)
        
        out, err = capfd.readouterr()
        assert strip_ansi(out) == read(log_file)
Example #4
0
def test_command_self(capfd):
    command(self = True, pip = True)
    out, err  = capfd.readouterr()
    sanitized = strip_ansi(out)

    assert "pip upto date." in sanitized
    assert "pipupgrade upto date." in sanitized

# def test_command(capfd):
#     project      = osp.join(PATH["DATA"], "project")
#     requirements = osp.join(project, "requirements.txt")
#     pipfile      = osp.join(project, "Pipfile")

#     command(verbose = True, yes = True, pip = True, ignore_error = True)
        # requirements = requirements, pipfile = pipfile, ignore_error = True)
Example #5
0
def test_command():
    with mock.patch.object(builtins, "input", lambda _: "Y"):
        assert command() == 0
Example #6
0
def test_command(capfd):
    project = osp.join(PATH["DATA"], "project")
    requirements = osp.join(project, "requirements.txt")
    pipfile = osp.join(project, "Pipfile")

    command(verbose=True, yes=True, pip=True, ignore_error=True)
Example #7
0
def test_command_self(capfd):
    command(self=True, yes=True)
    out, err = capfd.readouterr()
    assert "upto date." in out
Example #8
0
def test_command():
    with mock_input(StringIO("Y")):
        assert command() == 0
    pass