From 6f585170eae4bea3f248bd73b4c46b69ab485424 Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Apr 27 2015 16:58:00 +0000 Subject: Expand the unit-tests for write_gitolite_acls to check for several groups --- diff --git a/tests/test_progit_lib_git.py b/tests/test_progit_lib_git.py index 51436b5..a8d174b 100644 --- a/tests/test_progit_lib_git.py +++ b/tests/test_progit_lib_git.py @@ -137,6 +137,7 @@ repo requests/pingou/test3 repo = pagure.lib.get_project(self.session, 'test') + # Add a couple of groups msg = pagure.lib.add_group( self.session, group_name='sysadmin', @@ -146,7 +147,17 @@ repo requests/pingou/test3 ) self.session.commit() self.assertEqual(msg, 'User `pingou` added to the group `sysadmin`.') + msg = pagure.lib.add_group( + self.session, + group_name='devs', + group_type='user', + user='pingou', + is_admin=False, + ) + self.session.commit() + self.assertEqual(msg, 'User `pingou` added to the group `devs`.') + # Associate these groups to a project msg = pagure.lib.add_group_to_project( session=self.session, project=repo, @@ -155,6 +166,14 @@ repo requests/pingou/test3 ) self.session.commit() self.assertEqual(msg, 'Group added') + msg = pagure.lib.add_group_to_project( + session=self.session, + project=repo, + new_group='devs', + user='pingou', + ) + self.session.commit() + self.assertEqual(msg, 'Group added') # Add an user to a project msg = pagure.lib.add_user_to_project( @@ -186,28 +205,29 @@ repo requests/pingou/test3 data = stream.read() exp = """@sysadmin = pingou +@devs = pingou repo test R = @all - RW+ = @sysadmin + RW+ = @sysadmin @devs RW+ = pingou RW+ = foo repo docs/test R = @all - RW+ = @sysadmin + RW+ = @sysadmin @devs RW+ = pingou RW+ = foo repo tickets/test R = @all - RW+ = @sysadmin + RW+ = @sysadmin @devs RW+ = pingou RW+ = foo repo requests/test R = @all - RW+ = @sysadmin + RW+ = @sysadmin @devs RW+ = pingou RW+ = foo