Commit 5d1c2692 authored by Ben Boeckel's avatar Ben Boeckel
Browse files

tests: add test for reading groups

parent 287c4548
......@@ -34,6 +34,7 @@ MR_ID = 35 # https://gitlab.kitware.com/utils/rust-gitlab/merge_requests/35
MR_DISCUSSION_ID = 158 # https://gitlab.kitware.com/utils/rust-gitlab/merge_requests/35
NOTE_ID = 177359
PIPELINE_ID = 145400
GROUP_ID = 498 # https://gitlab.kitware.com/utils
if __name__ == '__main__':
......@@ -57,5 +58,6 @@ if __name__ == '__main__':
write_result(token, 'resource_label_event', '/projects/%s/issues/%d/resource_label_events' % (REPO, ISSUE_ID))
write_result(token, 'pipeline_basic', '/projects/%s/pipelines' % REPO)
write_result(token, 'pipeline', '/projects/%s/pipelines/%d' % (REPO, PIPELINE_ID))
write_result(token, 'group', '/groups/%s' % GROUP_ID)
# FIXME: these are hidden behind a `403 forbidden`, so we use a hardcoded example instead.
# write_result(token, 'pipeline_variable', '/projects/%s/pipelines/%d/variables' % (REPO, PIPELINE_ID))
This diff is collapsed.
......@@ -856,3 +856,22 @@ fn test_read_pipeline_variables() {
assert_eq!(var.variable_type, PipelineVariableType::EnvVar);
assert_eq!(var.value, "true");
}
#[test]
fn test_read_group() {
let group: Group = read_test_file("group");
assert_eq!(group.id, GroupId::new(498));
assert_eq!(group.name, "Utils");
assert_eq!(group.path, "utils");
assert_eq!(group.description.as_ref().unwrap(), "");
assert_eq!(group.visibility, VisibilityLevel::Public);
assert_eq!(group.lfs_enabled, true);
assert_eq!(group.avatar_url, None);
assert_eq!(group.web_url, "https://gitlab.kitware.com/groups/utils");
assert_eq!(group.request_access_enabled, false);
assert_eq!(group.full_name, "Utils");
assert_eq!(group.full_path, "utils");
assert_eq!(group.parent_id, None);
assert!(group.statistics.is_none());
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment