def test_action_response_on_success(fs_plugin): response = ActionResponse(fs_plugin) status = fs_plugin.status() for fs_status in status["fs_untracked"]: action = response.add("fetched_from_fs", fs_status, complete=False) for action in response.failed(): action.complete = True assert len(list(response.completed())) == 18 assert len(list(response.completed("fetched_from_fs"))) == 18 assert ( len(list(response.completed("fetched_from_fs", "added_from_pootle"))) == 18) assert list(response.failed()) == [] assert not response.has_failed
def test_action_response_failure(fs_plugin): response = ActionResponse(fs_plugin) status = fs_plugin.status() for fs_status in status["fs_untracked"]: action = response.add("fetched_from_fs", fs_status, complete=False) assert action.original_status == fs_status assert action.failed is True assert action.complete is False assert len(list(response.failed())) == 18 assert len(list(response.failed("fetched_from_fs"))) == 18 assert ( len(list(response.failed("fetched_from_fs", "added_from_pootle"))) == 18) assert list(response.completed()) == [] assert response.has_failed