Esempio n. 1
0
def test_onoff_machine_failure(config):
    td.clear_data()
    test_citizen = td.insert_test_citizen(config, collection_mode='ON-OFF')
    test_citizen_data = [{
        'tablename':
        'locationeventpertime',
        'presence': [
            0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0,
            0, 0
        ]
    }, {
        'tablename':
        'accelerometerevent',
        'presence': [
            0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0,
            0, 0
        ]
    }, {
        'tablename':
        'gyroscopeevent',
        'presence': [
            0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
            0, 0
        ]
    }]
    test_message = qa.instantiate_message(test_citizen, test_citizen_data,
                                          config)
    print(test_message.message_json)
    resp = qa.send_message(test_citizen, test_message, config['iLog'])
    print(resp)
Esempio n. 2
0
def test_points_question(config):
    td.clear_data()
    test_citizen = td.insert_test_citizen(config,collection_mode='CONTINUOUS',question_preference='POINTS')
    test_trip = td.insert_test_trip(test_citizen)
    qa.process_questions(config)
Esempio n. 3
0
def test_segment_question(config):
    td.clear_data()
    test_citizen = td.insert_test_citizen(config,collection_mode='CONTINUOUS',question_preference='SEGMENT')
    test_trip = td.insert_test_trip(test_citizen)
    qa.process_questions(config)