'Test mapping engine when groups is explicitly set.
If the groups list has only one group,
test if the transformation is done correctly'

def test_rule_engine_groups_mapping_only_one_group(self):

    mapping = mapping_fixtures.MAPPING_GROUPS_WITH_EMAIL
    assertion = mapping_fixtures.GROUPS_ASSERTION_ONLY_ONE_GROUP
    rp = mapping_utils.RuleProcessor(FAKE_MAPPING_ID, mapping['rules'])
    mapped_properties = rp.process(assertion)
    self.assertIsNotNone(mapped_properties)
    self.assertEqual('jsmith', mapped_properties['user']['name'])
    self.assertEqual('jill@example.com', mapped_properties['user']['email'])
    self.assertEqual('ALL    USERS', mapped_properties['group_names'][0]['name'])
