def test_list_all_log_versions(fake_bucket): # Note -- the return_value here has the form: # {'schemas': [{'logname': logname1, 'versions': [v1,v2,v2]}, # {'logname': logname2, 'versions': [v1,v2,v2]}]} # because of the nesting & potential out of order lists of versions direct # comparison with all schemas isn't possible return_value = list_all_log_versions(fake_bucket) assert_equivalent_sequences(return_value.keys(), ['schemas']) returned_log_names = [] for schema_dict in return_value['schemas']: lg_name = assert_dict_has_correct_structure(schema_dict) returned_log_names.append(lg_name) assert_equivalent_sequences(returned_log_names, LOG_NAMES)
def test_list_versions_with_no_match(fake_bucket_with_non_matching_keys): return_value = list_all_log_versions(fake_bucket_with_non_matching_keys) assert len(return_value['schemas']) == 0