Ejemplo n.º 1
0
def test_startup_with_missing_project(tmpdir, monkeypatch):
    #XXX: log entries
    boss = Mock()
    boss.return_value = [str(tmpdir.join('missing-dir'))]
    svc = ProjectService(boss)
    monkeypatch.setattr(svc, 'opt', boss)
    monkeypatch.setattr(svc , '_load_project', boss.load)

    svc._read_options()
    assert not boss.load.called
Ejemplo n.º 2
0
def test_startup_with_missing_project(tmpdir, monkeypatch):
    #XXX: log entries
    boss = Mock()
    boss.return_value = [str(tmpdir.join('missing-dir'))]
    svc = ProjectService(boss)
    monkeypatch.setattr(svc, 'opt', boss)
    monkeypatch.setattr(svc, '_load_project', boss.load)

    svc._read_options()
    assert not boss.load.called
Ejemplo n.º 3
0
def test_startup_with_empty_project_dir(tmpdir, monkeypatch):
    boss = Mock()
    boss.return_value = [str(tmpdir)]
    svc = ProjectService(boss)
    monkeypatch.setattr(svc, 'opt', boss)


    def mock_load_project(dirname):
        assert dirname == tmpdir
    monkeypatch.setattr(svc, '_load_project', mock_load_project)
    svc._read_options()
Ejemplo n.º 4
0
def test_startup_with_empty_project_dir(tmpdir, monkeypatch):
    boss = Mock()
    boss.return_value = [str(tmpdir)]
    svc = ProjectService(boss)
    monkeypatch.setattr(svc, 'opt', boss)

    def mock_load_project(dirname):
        assert dirname == tmpdir

    monkeypatch.setattr(svc, '_load_project', mock_load_project)
    svc._read_options()