# Path: tests/test_utils.py
# class TestGraphiteUtilsInternals(unittest.TestCase):
# class TestCaseWithTempDir(unittest.TestCase):
# class TestCaseWithFakeAccessor(TestCaseWithTempDir):
# class TestCaseWithAccessor(TestCaseWithTempDir):
# class TestFeatureSwitch(unittest.TestCase):
#     class WatcherMock:
#     def test_set_log_level(self):
#     def test_manipulate_paths_like_upstream(self):
#     def test_setup_graphite_root_path(self):
# def setup_logging():
# def prepare_graphite():
# def prepare_graphite_imports():
# def make_metric_with_defaults(name, metadata=None, **kwargs):
# def _make_easily_queryable_points(start, end, period):
#     def get_accessor(self):
#     def setUp(self):
#     def setUp(self):
#     def fake_drivers(self):
#     def setUpClass(cls):
#     def tearDownClass(cls):
#     def setUp(self):
#     def tearDown(self):
#     def flush(self):
#     def __drop_all_metrics(self):
#         def __init__(self):
#         def set(self):
#         def clear(self):
#         def watch(self):
#     def test_feature_switch_should_return_watcher_state_when_default_value_is_false(self):
#     def test_feature_switch_should_return_opposite_watcher_state_when_default_value_is_true(self):
#     KEYSPACE = "fake_keyspace"
#     CACHE_CLASS = bg_metadata_cache.MemoryCache
#     ACCESSOR_SETTINGS = {}
#     CACHE_CLASS = bg_metadata_cache.MemoryCache


import re
import unittest
import biggraphite.metric as bg_metric
from collections import defaultdict
from biggraphite import glob_utils as bg_glob
from tests import test_utils as bg_test_utils
            self.assertSequenceEqual(expected, parsed)
            self.assertEqual(fully_defined, parser.is_fully_defined(parsed), parsed)

    def test_filter_from_glob_should_keep_exact_match(self):
        name = "foo.bar.baz"
        filtered = bg_glob.filter_from_glob([name], name)
        self.assertEqual([name], filtered)

    def test_filter_from_glob_should_keep_regexp_match(self):
        regexp = "foo.bar.*"
        matching_name_1 = "foo.bar.baz"
        matching_name_2 = "foo.bar.qux"

        filtered = bg_glob.filter_from_glob([matching_name_1, matching_name_2], regexp)

        self.assertEqual([matching_name_1, matching_name_2], filtered)

    def test_filter_from_glob_should_remove_regexp_match(self):
        regexp = "foo.bar.*"
        matching_name = "foo.bar.baz"
        not_matching_name_1 = "bar.foo.qux"
        not_matching_name_2 = "bar.foo.quux"

        filtered = bg_glob.filter_from_glob(
            [matching_name, not_matching_name_1, not_matching_name_2], regexp
        )

        self.assertEqual([matching_name], filtered)



# Path: tests/test_utils.py
# class TestGraphiteUtilsInternals(unittest.TestCase):
# class TestCaseWithTempDir(unittest.TestCase):
# class TestCaseWithFakeAccessor(TestCaseWithTempDir):
# class TestCaseWithAccessor(TestCaseWithTempDir):
# class TestFeatureSwitch(unittest.TestCase):
#     class WatcherMock:
#     def test_set_log_level(self):
#     def test_manipulate_paths_like_upstream(self):
#     def test_setup_graphite_root_path(self):
# def setup_logging():
# def prepare_graphite():
# def prepare_graphite_imports():
# def make_metric_with_defaults(name, metadata=None, **kwargs):
# def _make_easily_queryable_points(start, end, period):
#     def get_accessor(self):
#     def setUp(self):
#     def setUp(self):
#     def fake_drivers(self):
#     def setUpClass(cls):
#     def tearDownClass(cls):
#     def setUp(self):
#     def tearDown(self):
#     def flush(self):
#     def __drop_all_metrics(self):
#         def __init__(self):
#         def set(self):
#         def clear(self):
#         def watch(self):
#     def test_feature_switch_should_return_watcher_state_when_default_value_is_false(self):
#     def test_feature_switch_should_return_opposite_watcher_state_when_default_value_is_true(self):
#     KEYSPACE = "fake_keyspace"
#     CACHE_CLASS = bg_metadata_cache.MemoryCache
#     ACCESSOR_SETTINGS = {}
#     CACHE_CLASS = bg_metadata_cache.MemoryCache


# Path: tests/test_glob_utils.py
import re
import unittest
import biggraphite.metric as bg_metric
from collections import defaultdict
from biggraphite import glob_utils as bg_glob
from tests import test_utils as bg_test_utils

            self.assertSequenceEqual(expected, parsed)
            self.assertEqual(fully_defined, parser.is_fully_defined(parsed), parsed)

    def test_filter_from_glob_should_keep_exact_match(self):
        name = "foo.bar.baz"
        filtered = bg_glob.filter_from_glob([name], name)
        self.assertEqual([name], filtered)

    def test_filter_from_glob_should_keep_regexp_match(self):
        regexp = "foo.bar.*"
        matching_name_1 = "foo.bar.baz"
        matching_name_2 = "foo.bar.qux"

        filtered = bg_glob.filter_from_glob([matching_name_1, matching_name_2], regexp)

        self.assertEqual([matching_name_1, matching_name_2], filtered)

    def test_filter_from_glob_should_remove_regexp_match(self):
        regexp = "foo.bar.*"
        matching_name = "foo.bar.baz"
        not_matching_name_1 = "bar.foo.qux"
        not_matching_name_2 = "bar.foo.quux"

        filtered = bg_glob.filter_from_glob(
            [matching_name, not_matching_name_1, not_matching_name_2], regexp
        )

        self.assertEqual([matching_name], filtered)



class TestGlobUtils(bg_test_utils.TestCaseWithFakeAccessor):