示例#1
0
def pytest_generate_tests(metafunc):

    if 'localfs_envs' in metafunc.fixturenames:

        from pootle_fs.state import FS_STATE
        env_names = [e for e in FS_STATE.keys() if e not in ["both_removed"]]
        metafunc.parametrize("localfs_env_names", env_names)

    if "possible_action_keys" in metafunc.fixturenames:
        metafunc.parametrize("possible_action_keys", _possible_actions())
示例#2
0
def test_fs_state_instance(settings, english):
    settings.POOTLE_FS_PATH = "/tmp/foo/"
    project = ProjectDBFactory(source_language=english)
    plugin = DummyPlugin(project)
    state = ProjectFSState(plugin)
    assert state.project == project
    assert state.states == FS_STATE.keys()
    assert (str(state) == (
        "<ProjectFSState(<DummyPlugin(%s)>): Nothing to report>" %
        project.fullname))
示例#3
0
文件: plugin.py 项目: ainslied/pootle
def pytest_generate_tests(metafunc):

    if 'localfs_envs' in metafunc.fixturenames:

        from pootle_fs.state import FS_STATE
        env_names = [e for e in FS_STATE.keys() if e not in ["both_removed"]]
        metafunc.parametrize("localfs_env_names", env_names)

    if "possible_action_keys" in metafunc.fixturenames:
        metafunc.parametrize("possible_action_keys", _possible_actions())
示例#4
0
文件: fs_state.py 项目: phlax/pootle
def test_fs_state_instance(settings, english):
    settings.POOTLE_FS_WORKING_PATH = "/tmp/foo/"
    project = ProjectDBFactory(source_language=english)
    plugin = DummyPlugin(project)
    state = ProjectFSState(plugin)
    assert state.project == project
    assert state.states == FS_STATE.keys()
    assert (
        str(state)
        == ("<ProjectFSState(<DummyPlugin(%s)>): Nothing to report>"
            % project.fullname))