Exemple #1
0
def test_update(dict_tmp_path, monkeypatch):
    # given
    monkeypatch.setattr(dictcli, 'download_dictionary',
                        lambda _url, dest: pathlib.Path(dest).touch())
    (dict_tmp_path / 'pl-PL-2-0.bdic').touch()
    assert polish().local_version < polish().remote_version

    # when
    dictcli.update(langs())

    # then
    assert polish().local_version == polish().remote_version
Exemple #2
0
def test_update(dict_tmpdir, monkeypatch):
    # given
    monkeypatch.setattr(dictcli, 'download_dictionary',
                        lambda _url, dest: py.path.local(dest).ensure())  # pylint: disable=no-member
    (dict_tmpdir / 'pl-PL-2-0.bdic').ensure()
    assert polish().local_version < polish().remote_version

    # when
    dictcli.update(langs())

    # then
    assert polish().local_version == polish().remote_version
def test_update(tmpdir, monkeypatch):
    # given
    monkeypatch.setattr(spell, 'dictionary_dir', lambda: str(tmpdir))
    monkeypatch.setattr(
        dictcli, 'download_dictionary',
        lambda _url, dest: py.path.local(dest).ensure())  # pylint: disable=no-member
    (tmpdir / 'pl-PL-2-0.bdic').ensure()
    assert polish().local_version < polish().remote_version

    # when
    dictcli.update(langs())

    # then
    assert polish().local_version == polish().remote_version