def create_group(self, groupname, groupdescription): print username1 secClient1 = SecurityClient(base_url, username1, password1) try: secClient1.create_group(groupname, groupdescription) group1 = secClient1.get_group(groupname) group1description = group1.description group1descriptionstring = str(group1description) if group1descriptionstring == groupdescription: print "Group '%s' created" % groupname else: message = "group '%s' not created" % groupname raise AssertionError(message) except Exception, exception: print exception message = "group '%s' not created" % groupname raise AssertionError(message)
def create_group_and_expect_error(self, groupname, groupdescription): secClient1 = SecurityClient(base_url, username1, password1) try: secClient1.create_group(groupname, groupdescription) """ group1 = secClient1.get_group(groupname) group1description = group1.description group1descriptionstring = str (group1description) if group1descriptionstring == groupdescription: message = "Group '%s' created" % groupname print 'group has been created' raise AssertionError(message) else: print "Group '%s' not created" % username message = "group '%s' not created" % groupname """ message = "Group '%s' created" % groupname print 'group has been created' raise AssertionError(message) except AssertionError: raise AssertionError(message) except Exception, exception: print exception print "group '%s' not created" % groupname