예제 #1
0
파일: test.py 프로젝트: WEEE-Open/pytarallo
def test_delete_one_feature():
    tarallo_session = Tarallo(t_url, t_token)
    # Insert a frequency
    assert tarallo_session.update_item_features('R70', {'frequency-hertz': 800000000})

    # Remove it
    assert tarallo_session.update_item_features('R70', {'frequency-hertz': None})

    # Check that it's gone
    assert 'frequency-hertz' not in tarallo_session.get_item('R70').features

    # Add it again
    assert tarallo_session.update_item_features('R70', {'frequency-hertz': 800000000})
예제 #2
0
파일: test.py 프로젝트: pippo314/pytarallo
def test_update_one_feature():
    tarallo_session = Tarallo(t_url, t_token)
    work = tarallo_session.get_item('R777').features['working']

    new_feat = 'yes'

    # If operation succeeds, return True
    assert tarallo_session.update_item_features('R777', {'working': new_feat})
    freq_updated = tarallo_session.get_item('R777').features['working']
    assert freq_updated == new_feat
예제 #3
0
파일: test.py 프로젝트: pippo314/pytarallo
def test_update_item_not_found_2():
    tarallo_session = Tarallo(t_url, t_token)
    tarallo_session.update_item_features('NONEXISTANT', {'color': None})
예제 #4
0
파일: test.py 프로젝트: pippo314/pytarallo
def test_update_item_not_found():
    tarallo_session = Tarallo(t_url, t_token)
    tarallo_session.update_item_features('NONEXISTENT', {'color': 'red'})
예제 #5
0
파일: test.py 프로젝트: pippo314/pytarallo
def test_empty_update():
    tarallo_session = Tarallo(t_url, t_token)
    tarallo_session.update_item_features('R189', {})
예제 #6
0
파일: test.py 프로젝트: pippo314/pytarallo
def test_impossible_update_no_such_feature():
    tarallo_session = Tarallo(t_url, t_token)
    tarallo_session.update_item_features('R198', {'nonexistent': 'foo'})
예제 #7
0
파일: test.py 프로젝트: pippo314/pytarallo
def test_impossible_update():
    tarallo_session = Tarallo(t_url, t_token)
    tarallo_session.update_item_features('R198', {'color': 'impossible'})