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})
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
def test_update_item_not_found_2(): tarallo_session = Tarallo(t_url, t_token) tarallo_session.update_item_features('NONEXISTANT', {'color': None})
def test_update_item_not_found(): tarallo_session = Tarallo(t_url, t_token) tarallo_session.update_item_features('NONEXISTENT', {'color': 'red'})
def test_empty_update(): tarallo_session = Tarallo(t_url, t_token) tarallo_session.update_item_features('R189', {})
def test_impossible_update_no_such_feature(): tarallo_session = Tarallo(t_url, t_token) tarallo_session.update_item_features('R198', {'nonexistent': 'foo'})
def test_impossible_update(): tarallo_session = Tarallo(t_url, t_token) tarallo_session.update_item_features('R198', {'color': 'impossible'})