File: create_hit_external.py

package info (click to toggle)
python-boto 2.49.0-4.1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 9,888 kB
  • sloc: python: 86,396; makefile: 112
file content (21 lines) | stat: -rw-r--r-- 964 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import unittest
import uuid
import datetime
from boto.mturk.question import ExternalQuestion

from _init_environment import SetHostMTurkConnection, external_url, \
        config_environment

class Test(unittest.TestCase):
        def setUp(self):
                config_environment()

        def test_create_hit_external(self):
                q = ExternalQuestion(external_url=external_url, frame_height=800)
                conn = SetHostMTurkConnection()
                keywords=['boto', 'test', 'doctest']
                create_hit_rs = conn.create_hit(question=q, lifetime=60*65, max_assignments=2, title="Boto External Question Test", keywords=keywords, reward = 0.05, duration=60*6, approval_delay=60*60, annotation='An annotation from boto external question test', response_groups=['Minimal', 'HITDetail', 'HITQuestion', 'HITAssignmentSummary',])
                assert(create_hit_rs.status == True)

if __name__ == "__main__":
        unittest.main()