def test_tag_exclude_all(self):
        instance = {
            'include': [
                'docker_image:ubuntu',
                'docker_image:debian',
            ],
            'exclude': ['.*'],
        }

        klass = get_check_class('docker')
        # NO-OP but loads the check
        with patch.object(klass, '_find_cgroup', _mocked_find_cgroup):
            check = klass('docker', {}, {})

        check._prepare_filters(instance)
        self.assertEquals(len(instance['exclude_patterns']), 1)
        self.assertEquals(len(instance['include_patterns']), 2)

        truth_table_exclusion = {
            'some_tag': True,
            'debian:ubuntu': True,
            'docker_image:centos': True,
            'docker_image:ubuntu': False,
            'docker_image:debian': False,
        }

        for tag, val in truth_table_exclusion.iteritems():
            self.assertEquals(
                check._is_container_excluded(instance, [tag]),
                val,
                "{0} expected {1} but is not".format(tag, val)
            )
tests the manage rules creation and deletion funcionalities:
dataset/ETHPy150Open serverdensity/sd-agent/tests/checks/mock/test_docker.py/DockerCheckTest.test_tag_exclude_all--crossover with--dataset/ETHPy150Open openstack/horizon/openstack_dashboard/test/integration_tests/tests/test_security_groups.py/TestSecuritygroup.test_managerules_create_delete_by_row