forked from Scifabric/pybossa
-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
RDISCROWD-7806: Remove bfs, dfs unused schedulers (#1013)
* remove bfs, dfs unused schedulers * remove incremental sched
- Loading branch information
Showing
8 changed files
with
13 additions
and
1,070 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -55,73 +55,3 @@ def test_get_active_users_lock(self): | |
time.sleep(EXPIRE_LOCK_DELAY + 1) | ||
count = get_active_user_count(project.id, sentinel.master) | ||
assert not count | ||
|
||
# Tests | ||
@with_request_context | ||
@patch('pybossa.api.pwd_manager.ProjectPasswdManager.password_needed') | ||
@patch('pybossa.api.task_run.request') | ||
def test_incremental_tasks(self, mock_request, passwd_needed): | ||
""" Test incremental SCHED strategy - second TaskRun receives first given answer""" | ||
passwd_needed.return_value = False | ||
self.create_2(sched='incremental') | ||
mock_request.remote_addr = '127.0.0.0' | ||
|
||
# Del previous TaskRuns | ||
self.del_task_runs() | ||
|
||
# Register | ||
self.register(fullname="John Doe", name="johndoe", password="p4ssw0rd") | ||
self.signout() | ||
self.register(fullname="Marie Doe", name="mariedoe", password="dr0wss4p") | ||
self.signout() | ||
self.register(fullname="Mario Doe", name="mariodoe", password="dr0wss4p") | ||
self.signout() | ||
self.signin() | ||
|
||
# Get the only task with no runs! | ||
res = self.app.get('api/project/1/newtask') | ||
data = json.loads(res.data) | ||
print("Task:%s" % data['id']) | ||
# Check that we received a clean Task | ||
assert data.get('info'), data | ||
assert not data.get('info').get('last_answer') | ||
|
||
# Submit an Answer for the assigned task | ||
tr = dict(project_id=data['project_id'], task_id=data['id'], info={'answer': 'No'}) | ||
tr = json.dumps(tr) | ||
|
||
res = self.app.post('/api/taskrun', data=tr) | ||
|
||
# No more tasks available for this user! | ||
res = self.app.get('api/project/1/newtask') | ||
data = json.loads(res.data) | ||
assert not data, data | ||
|
||
#### Get the only task now with an answer as Mario! | ||
self.signout() | ||
self.signin(email="[email protected]", password="dr0wss4p") | ||
res = self.app.get('api/project/1/newtask') | ||
data = json.loads(res.data) | ||
|
||
# Check that we received a Task with answer | ||
assert data.get('info'), data | ||
assert data.get('info').get('last_answer').get('answer') == 'No' | ||
|
||
# Submit a second Answer as Mario | ||
tr = dict(project_id=data['project_id'], task_id=data['id'], | ||
info={'answer': 'No No'}) | ||
tr = json.dumps(tr) | ||
|
||
res = self.app.post('/api/taskrun', data=tr) | ||
# no anonymous contributions | ||
assert res.status_code == 200 | ||
self.signout() | ||
|
||
#### Get the only task now with an answer as User2! | ||
self.signin(email="[email protected]", password="dr0wss4p") | ||
res = self.app.get('api/project/1/newtask') | ||
data = json.loads(res.data) | ||
|
||
# Check that we received a Task with answer | ||
assert data.get('info'), data | ||
assert data.get('info').get('last_answer').get('answer') == 'No No' |
Oops, something went wrong.