def _test_convert_firewall_rule_to_classifier(self, fw_rule):
        cg = self._create_classifier_group('neutron-fwaas')
        api.convert_firewall_rule_to_classifier(self.context, fw_rule, cg)

        # Save to the database
        self.context.session.add(cg)
        self.context.session.commit()

        # Refresh the classifier group from the DB
        cg = api.get_classifier_group(self.context, cg.id)
        self.assertGreater(len(cg.classifier_chain), 0)
    def _test_convert_security_group_rule_to_classifier(self,
                                                        security_group_rule):
        # TODO(sc68cal) make this not call session.commit directly
        cg = self._create_classifier_group('security-group')
        api.convert_security_group_rule_to_classifier(self.context,
                                                      security_group_rule, cg)
        # Save to the database
        self.context.session.add(cg)
        self.context.session.commit()

        # Refresh the classifier group from the DB
        cg = api.get_classifier_group(self.context, cg.id)
        self.assertGreater(len(cg.classifier_chain), 0)