MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / test_delegation_scope_builder

Function test_delegation_scope_builder

atomic-identity/src/delegation.rs:749–766  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

747
748 #[test]
749 fn test_delegation_scope_builder() {
750 let scope = DelegationScope::builder()
751 .permission(DelegationPermission::Read)
752 .permission(DelegationPermission::Record)
753 .repository_pattern("project/*")
754 .view_pattern("main")
755 .view_pattern("feature-*")
756 .max_changes(100)
757 .description("Limited access for testing")
758 .build();
759
760 assert!(scope.has_permission(DelegationPermission::Read));
761 assert!(scope.has_permission(DelegationPermission::Record));
762 assert_eq!(scope.repository_patterns.len(), 1);
763 assert_eq!(scope.view_patterns.len(), 2);
764 assert_eq!(scope.max_changes, Some(100));
765 assert!(scope.description.is_some());
766 }
767
768 #[test]
769 fn test_delegation_ci_cd_scope() {

Callers

nothing calls this directly

Calls 6

max_changesMethod · 0.80
view_patternMethod · 0.80
repository_patternMethod · 0.80
permissionMethod · 0.80
buildMethod · 0.45
descriptionMethod · 0.45

Tested by

no test coverage detected