Commit 77f3d36f authored by Ben Boeckel's avatar Ben Boeckel
Browse files

data: update to 9.0 data entities

parent bd2ebe7d
{"status": "success", "target_url": "https://buildbot.kitware.com/builders/rust-gitlab-megas-linux-debug/builds/41", "name": "rust-gitlab-megas-linux-debug", "author": {"username": "buildbot", "web_url": "https://gitlab.kitware.com/buildbot", "name": "buildbot", "state": "active", "avatar_url": "https://gitlab.kitware.com/uploads/user/avatar/35/buildbot-logo.png", "id": 35}, "finished_at": "2016-11-08T09:35:32.629-05:00", "created_at": "2016-11-08T09:35:32.627-05:00", "allow_failure": false, "sha": "de4ac3cf96cb8a0893be22b03f5171d934f9d392", "started_at": null, "ref": "master", "id": 931434, "description": "expected"}
{"status": "success", "target_url": "https://buildbot.kitware.com/builders/rust-gitlab-megas-linux-debug/builds/41", "name": "rust-gitlab-megas-linux-debug", "author": {"username": "buildbot", "web_url": "https://gitlab.kitware.com/buildbot", "name": "buildbot", "state": "active", "avatar_url": "https://gitlab.kitware.com/uploads/user/avatar/35/buildbot-logo.png", "id": 35}, "finished_at": "2016-11-08T09:35:32.629-05:00", "created_at": "2016-11-08T09:35:32.627-05:00", "allow_failure": false, "sha": "de4ac3cf96cb8a0893be22b03f5171d934f9d392", "coverage": null, "started_at": null, "ref": "master", "id": 931434, "description": "expected"}
{"due_date": null, "downvotes": 0, "web_url": "https://gitlab.kitware.com/utils/rust-gitlab/issues/6", "description": "", "subscribed": true, "title": "fix documentation warnings", "created_at": "2016-10-30T14:54:28.954-04:00", "labels": [], "updated_at": "2016-10-30T14:54:29.242-04:00", "iid": 6, "state": "opened", "user_notes_count": 0, "assignee": {"username": "ben.boeckel", "web_url": "https://gitlab.kitware.com/ben.boeckel", "name": "Ben Boeckel", "state": "active", "avatar_url": "https://secure.gravatar.com/avatar/2f5f7e99190174edb5a2f66b8653b0b2?s=80&d=identicon", "id": 13}, "author": {"username": "ben.boeckel", "web_url": "https://gitlab.kitware.com/ben.boeckel", "name": "Ben Boeckel", "state": "active", "avatar_url": "https://secure.gravatar.com/avatar/2f5f7e99190174edb5a2f66b8653b0b2?s=80&d=identicon", "id": 13}, "milestone": null, "upvotes": 0, "project_id": 855, "confidential": false, "id": 69328}
{"due_date": null, "downvotes": 0, "subscribed": true, "web_url": "https://gitlab.kitware.com/utils/rust-gitlab/issues/6", "description": "", "confidential": false, "title": "fix documentation warnings", "created_at": "2016-10-30T14:54:28.954-04:00", "labels": [], "updated_at": "2017-01-13T16:45:20.901-05:00", "iid": 6, "state": "closed", "user_notes_count": 0, "assignee": {"username": "ben.boeckel", "web_url": "https://gitlab.kitware.com/ben.boeckel", "name": "Ben Boeckel", "state": "active", "avatar_url": "https://secure.gravatar.com/avatar/2f5f7e99190174edb5a2f66b8653b0b2?s=80&d=identicon", "id": 13}, "author": {"username": "ben.boeckel", "web_url": "https://gitlab.kitware.com/ben.boeckel", "name": "Ben Boeckel", "state": "active", "avatar_url": "https://secure.gravatar.com/avatar/2f5f7e99190174edb5a2f66b8653b0b2?s=80&d=identicon", "id": 13}, "milestone": null, "upvotes": 0, "project_id": 855, "id": 69328}
{"due_date": null, "downvotes": 0, "web_url": "https://gitlab.kitware.com/utils/rust-gitlab/issues/5", "description": "The workflow currently requires that the robot be able to register itself as a webhook for new projects. An API needs added for this.\n\nCc: @brad.king", "subscribed": true, "title": "Add project hook APIs", "created_at": "2016-10-04T14:59:37.178-04:00", "labels": [], "updated_at": "2016-10-04T16:18:57.519-04:00", "iid": 5, "state": "closed", "user_notes_count": 0, "assignee": {"username": "ben.boeckel", "web_url": "https://gitlab.kitware.com/ben.boeckel", "name": "Ben Boeckel", "state": "active", "avatar_url": "https://secure.gravatar.com/avatar/2f5f7e99190174edb5a2f66b8653b0b2?s=80&d=identicon", "id": 13}, "author": {"username": "ben.boeckel", "web_url": "https://gitlab.kitware.com/ben.boeckel", "name": "Ben Boeckel", "state": "active", "avatar_url": "https://secure.gravatar.com/avatar/2f5f7e99190174edb5a2f66b8653b0b2?s=80&d=identicon", "id": 13}, "milestone": null, "upvotes": 0, "project_id": 855, "confidential": false, "id": 69075}
{"due_date": null, "downvotes": 0, "subscribed": true, "web_url": "https://gitlab.kitware.com/utils/rust-gitlab/issues/5", "description": "The workflow currently requires that the robot be able to register itself as a webhook for new projects. An API needs added for this.\n\nCc: @brad.king", "confidential": false, "title": "Add project hook APIs", "created_at": "2016-10-04T14:59:37.178-04:00", "labels": [], "updated_at": "2016-10-04T16:18:57.519-04:00", "iid": 5, "state": "closed", "user_notes_count": 0, "assignee": {"username": "ben.boeckel", "web_url": "https://gitlab.kitware.com/ben.boeckel", "name": "Ben Boeckel", "state": "active", "avatar_url": "https://secure.gravatar.com/avatar/2f5f7e99190174edb5a2f66b8653b0b2?s=80&d=identicon", "id": 13}, "author": {"username": "ben.boeckel", "web_url": "https://gitlab.kitware.com/ben.boeckel", "name": "Ben Boeckel", "state": "active", "avatar_url": "https://secure.gravatar.com/avatar/2f5f7e99190174edb5a2f66b8653b0b2?s=80&d=identicon", "id": 13}, "milestone": null, "upvotes": 0, "project_id": 855, "id": 69075}
{"target_project_id": 855, "source_branch": "migrate-to-reqwest", "downvotes": 0, "labels": [], "updated_at": "2016-12-07T10:45:22.184-05:00", "work_in_progress": false, "assignee": null, "user_notes_count": 7, "id": 21211, "force_remove_source_branch": true, "target_branch": "master", "subscribed": true, "title": "Migrate to reqwest", "merge_commit_sha": null, "state": "opened", "upvotes": 0, "project_id": 855, "description": "Currently, we cannot use both `rust-gitlab` (depending on `hyper`'s SSL support) and `libgit2` in the same application, because they require different versions of `rust-openssl` (hyper: 0.7.x, libgit2: 0.9.x).\r\n(I want to use the both libraries in my GitLab helper application.)\r\n\r\nseanmonstar (hyper's author) recommends using reqwest for HTTP clients.\r\n\r\nhttps://github.com/hyperium/hyper/issues/907#issuecomment-255509020\r\n\r\n> reqwest: Be the convenient, higher level Client crate. This will release very soon, and depend on rust-native-tls. Everyone using hyper for a client should be able to easily switch the reqwest, getting better TLS support immediately, and a (as much as possible) not-breaking API, even as hyper v0.10 comes out with its async Client.\r\n\r\nthoughts?\r\n\r\n(This MR is based on !51 changes)", "iid": 52, "milestone": null, "source_project_id": 1154, "merge_when_build_succeeds": false, "merge_status": "can_be_merged", "should_remove_source_branch": null, "created_at": "2016-12-07T09:43:31.653-05:00", "author": {"username": "gifnksm", "web_url": "https://gitlab.kitware.com/gifnksm", "name": "NAKASHIMA, Makoto", "state": "active", "avatar_url": "https://secure.gravatar.com/avatar/4f544d7f9fc4ae2b04512317f1a06b6e?s=80&d=identicon", "id": 1489}, "sha": "f2784e0607d08e79b361ccf58a8379b04de2df35", "web_url": "https://gitlab.kitware.com/utils/rust-gitlab/merge_requests/52"}
{"target_project_id": 855, "source_branch": "add_hook-api", "downvotes": 0, "labels": [], "updated_at": "2016-10-04T16:18:57.940-04:00", "work_in_progress": false, "assignee": {"username": "brad.king", "web_url": "https://gitlab.kitware.com/brad.king", "name": "Brad King", "state": "active", "avatar_url": "https://secure.gravatar.com/avatar/0617392a2f9fd505720d0c42cefc1a10?s=80&d=identicon", "id": 10}, "user_notes_count": 3, "id": 20215, "force_remove_source_branch": true, "target_branch": "master", "subscribed": true, "title": "gitlab: expose hook addition API", "merge_commit_sha": null, "state": "merged", "upvotes": 0, "project_id": 855, "description": "Fixes #5.", "iid": 35, "milestone": null, "source_project_id": 856, "merge_when_build_succeeds": false, "merge_status": "can_be_merged", "should_remove_source_branch": null, "created_at": "2016-10-04T15:56:43.276-04:00", "author": {"username": "ben.boeckel", "web_url": "https://gitlab.kitware.com/ben.boeckel", "name": "Ben Boeckel", "state": "active", "avatar_url": "https://secure.gravatar.com/avatar/2f5f7e99190174edb5a2f66b8653b0b2?s=80&d=identicon", "id": 13}, "sha": "04e94ae667024a62a90179f395bfdc2b35f3efd2", "web_url": "https://gitlab.kitware.com/utils/rust-gitlab/merge_requests/35"}
{"id":855,"description":"Rust library for communicating with a Gitlab instance.","default_branch":"master","tag_list":[],"public":true,"archived":false,"visibility_level":20,"ssh_url_to_repo":"git@gitlab.kitware.com:utils/rust-gitlab.git","http_url_to_repo":"https://gitlab.kitware.com/utils/rust-gitlab.git","web_url":"https://gitlab.kitware.com/utils/rust-gitlab","name":"rust-gitlab","name_with_namespace":"Utils / rust-gitlab","path":"rust-gitlab","path_with_namespace":"utils/rust-gitlab","container_registry_enabled":true,"issues_enabled":true,"merge_requests_enabled":true,"wiki_enabled":true,"builds_enabled":false,"snippets_enabled":false,"created_at":"2016-06-29T13:35:12.495-04:00","last_activity_at":"2017-01-18T12:27:17.734-05:00","shared_runners_enabled":true,"lfs_enabled":true,"creator_id":13,"namespace":{"id":498,"name":"Utils","path":"utils","kind":"group"},"avatar_url":null,"star_count":0,"forks_count":3,"open_issues_count":1,"runners_token":"M3yGSHxyULoxbXoSbG1o","public_builds":true,"shared_with_groups":[],"only_allow_merge_if_build_succeeds":false,"request_access_enabled":true,"only_allow_merge_if_all_discussions_are_resolved":null,"permissions":{"project_access":null,"group_access":{"access_level":50,"notification_level":3}}}
{"lfs_enabled": true, "request_access_enabled": true, "forks_count": 3, "only_allow_merge_if_all_discussions_are_resolved": null, "container_registry_enabled": true, "web_url": "https://gitlab.kitware.com/utils/rust-gitlab", "wiki_enabled": true, "public_builds": true, "id": 855, "merge_requests_enabled": true, "archived": false, "snippets_enabled": false, "http_url_to_repo": "https://gitlab.kitware.com/utils/rust-gitlab.git", "namespace": {"path": "utils", "kind": "group", "id": 498, "full_path": "utils", "name": "Utils"}, "star_count": 0, "avatar_url": null, "issues_enabled": true, "path_with_namespace": "utils/rust-gitlab", "public": true, "shared_with_groups": [], "description": "Rust library for communicating with a Gitlab instance.", "default_branch": "master", "only_allow_merge_if_build_succeeds": false, "ssh_url_to_repo": "git@gitlab.kitware.com:utils/rust-gitlab.git", "path": "rust-gitlab", "visibility_level": 20, "permissions": {"group_access": {"notification_level": 3, "access_level": 50}, "project_access": null}, "open_issues_count": 0, "last_activity_at": "2017-04-03T09:09:26.696-04:00", "name": "rust-gitlab", "name_with_namespace": "Utils / rust-gitlab", "created_at": "2016-06-29T13:35:12.495-04:00", "builds_enabled": false, "creator_id": 13, "shared_runners_enabled": true, "tag_list": []}
{"note_events": true, "tag_push_events": true, "url": "http://kwrobot02:8080/event", "created_at": "2016-06-29T13:35:15.771-04:00", "enable_ssl_verification": false, "pipeline_events": false, "issues_events": true, "push_events": true, "merge_requests_events": true, "build_events": false, "project_id": 855, "id": 887, "wiki_page_events": false}
{"note_events": true, "tag_push_events": true, "url": "http://kwrobot02:8082/gitlab.kitware.com", "created_at": "2016-12-16T11:37:24.589-05:00", "enable_ssl_verification": true, "pipeline_events": true, "issues_events": true, "push_events": true, "merge_requests_events": true, "build_events": true, "project_id": 855, "id": 1262, "wiki_page_events": true}
{"commit": {"committer_email": "kwrobot@kitware.com", "author_email": "brad.king@kitware.com", "committer_name": "Kitware Robot", "author_name": "Brad King", "parent_ids": ["de4ac3cf96cb8a0893be22b03f5171d934f9d392", "370267d429821e0f4354cb43c52ee2053c2cb744"], "committed_date": "2016-11-11T09:59:37.000-05:00", "message": "Merge topic 'nullable-fields'\n\n370267d4 types: more nullable fields\n\nAcked-by: Kitware Robot <kwrobot@kitware.com>\nReviewed-by: Brad King <brad.king@kitware.com>\nMerge-request: !47\n", "authored_date": "2016-11-11T09:59:37.000-05:00", "id": "a418466df1c8b4e676e97d7d8d0d3cdfb1336558"}, "protected": true, "name": "master", "developers_can_push": false, "developers_can_merge": false}
{"name": "master", "developers_can_merge": false, "protected": true, "developers_can_push": false, "commit": {"committer_email": "kwrobot@kitware.com", "short_id": "06356d86", "title": "Merge topic 'release-0.817.1'", "author_email": "brad.king@kitware.com", "committer_name": "Kitware Robot", "created_at": "2017-03-30T15:23:13.000-04:00", "author_name": "Brad King", "parent_ids": ["a16142046f63bd2ed6d9ffe858013fb5c927539b", "a0cfdfdaa5caf7476c8b57c8ae23aa250f7b6711"], "committed_date": "2017-03-30T15:23:13.000-04:00", "message": "Merge topic 'release-0.817.1'\n\na0cfdfda cargo: prep for 0.817.1\nb6587827 cargo: loosen the error-chain dependency\n9323c337 cargo: separate public and private dependencies\n\nAcked-by: Kitware Robot <kwrobot@kitware.com>\nReviewed-by: Brad King <brad.king@kitware.com>\nMerge-request: !83\n", "authored_date": "2017-03-30T19:23:11.000+00:00", "id": "06356d86ed28f28c99052338fad2b506214bf5f7"}, "merged": false}
{"status": "success", "stats": {"deletions": 0, "additions": 8, "total": 8}, "short_id": "de4ac3cf", "title": "Merge topic 'mr-awards'", "author_email": "brad.king@kitware.com", "created_at": "2016-11-08T09:30:13.000-05:00", "author_name": "Brad King", "parent_ids": ["559f5f4a2bfe1f48e9e95afa09c029deb655cf7d", "a222c5539569cda6999b8069f1e51a5202c30711"], "committed_date": "2016-11-08T09:30:13.000-05:00", "message": "Merge topic 'mr-awards'\n\na222c553 gitlab: add a method for MR award queries\n\nAcked-by: Kitware Robot <kwrobot@kitware.com>\nReviewed-by: Brad King <brad.king@kitware.com>\nMerge-request: !46\n", "authored_date": "2016-11-08T09:30:13.000-05:00", "id": "de4ac3cf96cb8a0893be22b03f5171d934f9d392"}
{"status": "success", "committer_email": "kwrobot@kitware.com", "stats": {"deletions": 0, "additions": 8, "total": 8}, "short_id": "de4ac3cf", "title": "Merge topic 'mr-awards'", "author_email": "brad.king@kitware.com", "committer_name": "Kitware Robot", "created_at": "2016-11-08T09:30:13.000-05:00", "author_name": "Brad King", "parent_ids": ["559f5f4a2bfe1f48e9e95afa09c029deb655cf7d", "a222c5539569cda6999b8069f1e51a5202c30711"], "committed_date": "2016-11-08T09:30:13.000-05:00", "message": "Merge topic 'mr-awards'\n\na222c553 gitlab: add a method for MR award queries\n\nAcked-by: Kitware Robot <kwrobot@kitware.com>\nReviewed-by: Brad King <brad.king@kitware.com>\nMerge-request: !46\n", "authored_date": "2016-11-08T09:30:13.000-05:00", "id": "de4ac3cf96cb8a0893be22b03f5171d934f9d392"}
......@@ -102,6 +102,7 @@ fn test_read_commit_status() {
assert_eq!(commit_status.author.avatar_url,
"https://gitlab.kitware.com/uploads/user/avatar/35/buildbot-logo.png");
assert_eq!(commit_status.author.id, UserId::new(35));
assert_eq!(commit_status.coverage, None);
}
#[test]
......@@ -113,13 +114,13 @@ fn test_read_issue() {
assert_eq!(issue.project_id, ProjectId::new(855));
assert_eq!(issue.title, "fix documentation warnings");
assert_eq!(issue.description, "");
assert_eq!(issue.state, IssueState::Opened);
assert_eq!(issue.state, IssueState::Closed);
assert_eq!(issue.created_at,
UTC.ymd(2016, 10, 30)
.and_hms_milli(18, 54, 28, 954));
assert_eq!(issue.updated_at,
UTC.ymd(2016, 10, 30)
.and_hms_milli(18, 54, 29, 242));
UTC.ymd(2017, 1, 13)
.and_hms_milli(21, 45, 20, 901));
assert!(issue.labels.is_empty());
assert!(issue.milestone.is_none());
assert_eq!(issue.author.username, "ben.boeckel");
......@@ -223,46 +224,42 @@ fn test_read_member() {
fn test_read_merge_request() {
let merge_request: MergeRequest = read_test_file("merge_request");
assert_eq!(merge_request.id, MergeRequestId::new(21211));
assert_eq!(merge_request.iid, 52);
assert_eq!(merge_request.id, MergeRequestId::new(20215));
assert_eq!(merge_request.iid, 35);
assert_eq!(merge_request.project_id, ProjectId::new(855));
assert_eq!(merge_request.title, "Migrate to reqwest");
assert_eq!(merge_request.description,
Some("Currently, we cannot use both `rust-gitlab` (depending on `hyper`'s SSL \
support) and `libgit2` in the same application, because they require \
different versions of `rust-openssl` (hyper: 0.7.x, libgit2: 0.9.x).\r\n(I \
want to use the both libraries in my GitLab helper \
application.)\r\n\r\nseanmonstar (hyper's author) recommends using reqwest \
for HTTP clients.\r\n\r\nhttps://github.\
com/hyperium/hyper/issues/907#issuecomment-255509020\r\n\r\n> reqwest: Be \
the convenient, higher level Client crate. This will release very soon, \
and depend on rust-native-tls. Everyone using hyper for a client should be \
able to easily switch the reqwest, getting better TLS support immediately, \
and a (as much as possible) not-breaking API, even as hyper v0.10 comes \
out with its async Client.\r\n\r\nthoughts?\r\n\r\n(This MR is based on \
!51 changes)"
.to_string()));
assert_eq!(merge_request.state, MergeRequestState::Opened);
assert_eq!(merge_request.title, "gitlab: expose hook addition API");
assert_eq!(merge_request.description, Some("Fixes #5.".to_string()));
assert_eq!(merge_request.state, MergeRequestState::Merged);
assert_eq!(merge_request.created_at,
UTC.ymd(2016, 12, 7)
.and_hms_milli(14, 43, 31, 653));
UTC.ymd(2016, 10, 4)
.and_hms_milli(19, 56, 43, 276));
assert_eq!(merge_request.updated_at,
UTC.ymd(2016, 12, 7)
.and_hms_milli(15, 45, 22, 184));
UTC.ymd(2016, 10, 4)
.and_hms_milli(20, 18, 57, 940));
assert_eq!(merge_request.target_branch, "master");
assert_eq!(merge_request.source_branch, "migrate-to-reqwest");
assert_eq!(merge_request.source_branch, "add_hook-api");
assert_eq!(merge_request.upvotes, 0);
assert_eq!(merge_request.downvotes, 0);
assert_eq!(merge_request.author.username, "gifnksm");
assert_eq!(merge_request.author.username, "ben.boeckel");
assert_eq!(merge_request.author.web_url,
"https://gitlab.kitware.com/gifnksm");
assert_eq!(merge_request.author.name, "NAKASHIMA, Makoto");
"https://gitlab.kitware.com/ben.boeckel");
assert_eq!(merge_request.author.name, "Ben Boeckel");
assert_eq!(merge_request.author.state, UserState::Active);
assert_eq!(merge_request.author.avatar_url,
"https://secure.gravatar.com/avatar/4f544d7f9fc4ae2b04512317f1a06b6e?s=80&d=identicon");
assert_eq!(merge_request.author.id, UserId::new(1489));
assert!(merge_request.assignee.is_none());
assert_eq!(merge_request.source_project_id, ProjectId::new(1154));
"https://secure.gravatar.com/avatar/2f5f7e99190174edb5a2f66b8653b0b2?s=80&d=identicon");
assert_eq!(merge_request.author.id, UserId::new(13));
if let Some(ref assignee) = merge_request.assignee {
assert_eq!(assignee.username, "brad.king");
assert_eq!(assignee.web_url, "https://gitlab.kitware.com/brad.king");
assert_eq!(assignee.name, "Brad King");
assert_eq!(assignee.state, UserState::Active);
assert_eq!(assignee.avatar_url,
"https://secure.gravatar.com/avatar/0617392a2f9fd505720d0c42cefc1a10?s=80&d=identicon");
assert_eq!(assignee.id, UserId::new(10));
} else {
panic!("expected to have an assignee for the merge request");
}
assert_eq!(merge_request.source_project_id, ProjectId::new(856));
assert_eq!(merge_request.target_project_id, ProjectId::new(855));
assert!(merge_request.labels.is_empty());
assert_eq!(merge_request.work_in_progress, false);
......@@ -270,14 +267,14 @@ fn test_read_merge_request() {
assert_eq!(merge_request.merge_when_build_succeeds, false);
assert_eq!(merge_request.merge_status, MergeStatus::CanBeMerged);
assert_eq!(merge_request.sha,
Some(ObjectId::new("f2784e0607d08e79b361ccf58a8379b04de2df35")));
Some(ObjectId::new("04e94ae667024a62a90179f395bfdc2b35f3efd2")));
assert_eq!(merge_request.merge_commit_sha, None);
assert_eq!(merge_request.subscribed, true);
assert_eq!(merge_request.user_notes_count, 7);
assert_eq!(merge_request.user_notes_count, 3);
assert_eq!(merge_request.should_remove_source_branch, None);
assert_eq!(merge_request.force_remove_source_branch, Some(true));
assert_eq!(merge_request.web_url,
"https://gitlab.kitware.com/utils/rust-gitlab/merge_requests/52");
"https://gitlab.kitware.com/utils/rust-gitlab/merge_requests/35");
}
#[test]
......@@ -335,8 +332,8 @@ fn test_read_project() {
UTC.ymd(2016, 6, 29)
.and_hms_milli(17, 35, 12, 495));
assert_eq!(project.last_activity_at,
UTC.ymd(2017, 1, 18)
.and_hms_milli(17, 27, 17, 734));
UTC.ymd(2017, 4, 3)
.and_hms_milli(13, 9, 26, 696));
assert_eq!(project.shared_runners_enabled, true);
assert_eq!(project.lfs_enabled, true);
assert_eq!(project.creator_id, UserId::new(13));
......@@ -345,11 +342,12 @@ fn test_read_project() {
assert_eq!(project.namespace.id(),
NamespaceId::Group(GroupId::new(498)));
assert_eq!(project.namespace.kind, NamespaceKind::Group);
assert_eq!(project.namespace.full_path, "utils");
assert!(project.forked_from_project.is_none());
assert_eq!(project.avatar_url, None);
assert_eq!(project.star_count, 0);
assert_eq!(project.forks_count, 3);
assert_eq!(project.open_issues_count, Some(1));
assert_eq!(project.open_issues_count, Some(0));
assert_eq!(project.public_builds, true);
assert!(project.shared_with_groups.is_empty());
assert_eq!(project.only_allow_merge_if_build_succeeds, Some(false));
......@@ -378,20 +376,20 @@ fn test_read_project() {
fn test_read_project_hook() {
let project_hook: ProjectHook = read_test_file("project_hook");
assert_eq!(project_hook.id, HookId::new(887));
assert_eq!(project_hook.url, "http://kwrobot02:8080/event");
assert_eq!(project_hook.id, HookId::new(1262));
assert_eq!(project_hook.url, "http://kwrobot02:8082/gitlab.kitware.com");
assert_eq!(project_hook.created_at,
UTC.ymd(2016, 6, 29)
.and_hms_milli(17, 35, 15, 771));
UTC.ymd(2016, 12, 16)
.and_hms_milli(16, 37, 24, 589));
assert_eq!(project_hook.push_events, true);
assert_eq!(project_hook.tag_push_events, true);
assert_eq!(project_hook.issues_events, true);
assert_eq!(project_hook.merge_requests_events, true);
assert_eq!(project_hook.note_events, true);
assert_eq!(project_hook.enable_ssl_verification, false);
assert_eq!(project_hook.build_events, false);
assert_eq!(project_hook.pipeline_events, false);
assert_eq!(project_hook.wiki_page_events, false);
assert_eq!(project_hook.enable_ssl_verification, true);
assert_eq!(project_hook.build_events, true);
assert_eq!(project_hook.pipeline_events, true);
assert_eq!(project_hook.wiki_page_events, true);
}
#[test]
......@@ -403,28 +401,34 @@ fn test_read_repo_branch() {
assert_eq!(commit.author_email, "brad.king@kitware.com");
assert_eq!(commit.author_name, "Brad King");
assert_eq!(commit.authored_date,
UTC.ymd(2016, 11, 11)
.and_hms_milli(14, 59, 37, 0));
UTC.ymd(2017, 3, 30)
.and_hms_milli(19, 23, 11, 0));
assert_eq!(commit.committed_date,
UTC.ymd(2016, 11, 11)
.and_hms_milli(14, 59, 37, 0));
UTC.ymd(2017, 3, 30)
.and_hms_milli(19, 23, 13, 0));
assert_eq!(commit.created_at,
UTC.ymd(2017, 3, 30)
.and_hms_milli(19, 23, 13, 0));
assert_eq!(commit.committer_email, "kwrobot@kitware.com");
assert_eq!(commit.committer_name, "Kitware Robot");
assert_eq!(commit.id,
ObjectId::new("a418466df1c8b4e676e97d7d8d0d3cdfb1336558"));
ObjectId::new("06356d86ed28f28c99052338fad2b506214bf5f7"));
assert_eq!(commit.short_id, ObjectId::new("06356d86"));
assert_eq!(commit.message,
"Merge topic 'nullable-fields'\n\n370267d4 types: more nullable \
fields\n\nAcked-by: Kitware Robot <kwrobot@kitware.com>\nReviewed-by: Brad \
King <brad.king@kitware.com>\nMerge-request: !47\n");
"Merge topic 'release-0.817.1'\n\na0cfdfda cargo: prep for 0.817.1\nb6587827 \
cargo: loosen the error-chain dependency\n9323c337 cargo: separate public and \
private dependencies\n\nAcked-by: Kitware Robot \
<kwrobot@kitware.com>\nReviewed-by: Brad King \
<brad.king@kitware.com>\nMerge-request: !83\n");
assert_eq!(commit.parent_ids,
vec![
ObjectId::new("de4ac3cf96cb8a0893be22b03f5171d934f9d392"),
ObjectId::new("370267d429821e0f4354cb43c52ee2053c2cb744"),
ObjectId::new("a16142046f63bd2ed6d9ffe858013fb5c927539b"),
ObjectId::new("a0cfdfdaa5caf7476c8b57c8ae23aa250f7b6711"),
]);
} else {
panic!("expected to have a commit for the branch");
}
assert_eq!(repo_branch.merged, None);
assert_eq!(repo_branch.merged, Some(false));
assert_eq!(repo_branch.protected, Some(true));
assert_eq!(repo_branch.developers_can_push, Some(false));
assert_eq!(repo_branch.developers_can_merge, Some(false));
......@@ -440,6 +444,8 @@ fn test_read_repo_commit_detail() {
assert_eq!(repo_commit_detail.title, "Merge topic 'mr-awards'");
assert_eq!(repo_commit_detail.author_name, "Brad King");
assert_eq!(repo_commit_detail.author_email, "brad.king@kitware.com");
assert_eq!(repo_commit_detail.committer_name, "Kitware Robot");
assert_eq!(repo_commit_detail.committer_email, "kwrobot@kitware.com");
assert_eq!(repo_commit_detail.created_at,
UTC.ymd(2016, 11, 8)
.and_hms_milli(14, 30, 13, 0));
......
Supports Markdown
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