# coding: utf-8 from utils.test_config import * from utils.string_utils import * from helix_web_services_client.models import Counter api = api_as_super() rand = random_string() counter_spec = Counter() counter_spec.value = "1" api.server_counters_counter_put('localhost', rand, counter_spec) all_counters = api.server_counters_get('localhost') assert any(x.counter == rand for x in all_counters), "did not find new counter" saved = api.server_counters_counter_get('localhost', rand) assert saved.value == counter_spec.value api.server_counters_counter_increment_post('localhost', rand) updated = api.server_counters_counter_get('localhost', rand) assert updated.value == "2" api.server_counters_counter_delete('localhost', rand) all_counters = api.server_counters_get('localhost') assert any(x.counter == rand for x in all_counters) == False, "did not delete counter"