| OLD | NEW |
| 1 >>> import uuid | 1 >>> import uuid |
| 2 >>> import datetime | 2 >>> import datetime |
| 3 >>> from _init_environment import MTurkConnection, mturk_host | 3 >>> from _init_environment import MTurkConnection, mturk_host |
| 4 >>> from boto.mturk.question import Question, QuestionContent, AnswerSpecificati
on, FreeTextAnswer | 4 >>> from boto.mturk.question import Question, QuestionContent, AnswerSpecificati
on, FreeTextAnswer |
| 5 | 5 |
| 6 >>> conn = MTurkConnection(host=mturk_host) | 6 >>> conn = MTurkConnection(host=mturk_host) |
| 7 | 7 |
| 8 # create content for a question | 8 # create content for a question |
| 9 >>> qn_content = QuestionContent() | 9 >>> qn_content = QuestionContent() |
| 10 >>> qn_content.append_field('Title', 'Boto no hit type question content') | 10 >>> qn_content.append_field('Title', 'Boto no hit type question content') |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 # this is a valid request | 77 # this is a valid request |
| 78 >>> assignments_rs.status | 78 >>> assignments_rs.status |
| 79 True | 79 True |
| 80 | 80 |
| 81 >>> int(assignments_rs.NumResults) >= 1 | 81 >>> int(assignments_rs.NumResults) >= 1 |
| 82 True | 82 True |
| 83 | 83 |
| 84 >>> len(assignments_rs) == int(assignments_rs.NumResults) | 84 >>> len(assignments_rs) == int(assignments_rs.NumResults) |
| 85 True | 85 True |
| 86 | 86 |
| 87 >>> assignments_rs.PageNumber | 87 >>> int(assignments_rs.PageNumber) |
| 88 u'1' | 88 1 |
| 89 | 89 |
| 90 >>> assignments_rs.TotalNumResults >= 1 | 90 >>> int(assignments_rs.TotalNumResults) >= 1 |
| 91 True | 91 True |
| 92 | 92 |
| 93 # should contain at least one Assignment object | 93 # should contain at least one Assignment object |
| 94 >>> assignments_rs # doctest: +ELLIPSIS | 94 >>> assignments_rs # doctest: +ELLIPSIS |
| 95 [<boto.mturk.connection.Assignment instance at ...] | 95 [<boto.mturk.connection.Assignment instance at ...] |
| 96 | 96 |
| 97 # should have returned assignments for the requested HIT id | 97 # should have returned assignments for the requested HIT id |
| 98 >>> assignment = assignments_rs[0] | 98 >>> assignment = assignments_rs[0] |
| 99 | 99 |
| 100 >>> assignment.HITId == hit_id | 100 >>> assignment.HITId == hit_id |
| (...skipping 19 matching lines...) Expand all Loading... |
| 120 | 120 |
| 121 >>> qid, text = answer.fields[0] | 121 >>> qid, text = answer.fields[0] |
| 122 | 122 |
| 123 >>> text # doctest: +ELLIPSIS | 123 >>> text # doctest: +ELLIPSIS |
| 124 u'...' | 124 u'...' |
| 125 | 125 |
| 126 # question identifier should be a unicode string | 126 # question identifier should be a unicode string |
| 127 >>> qid # doctest: +ELLIPSIS | 127 >>> qid # doctest: +ELLIPSIS |
| 128 u'...' | 128 u'...' |
| 129 | 129 |
| OLD | NEW |