def test_filter_hashes(self):
    'Test filter_hashes filters the provided hash correctly.'
    with self.swap(build, 'FILEPATHS_PROVIDED_TO_FRONTEND', ('*',)):
        hashes = {'path/to/file.js': '123456', 'path/file.min.js': '123456'}
        filtered_hashes = build.filter_hashes(hashes)
        self.assertEqual(filtered_hashes['/path/to/file.js'], hashes['path/to/file.js'])
        self.assertEqual(filtered_hashes['/path/file.min.js'], hashes['path/file.min.js'])
    with self.swap(build, 'FILEPATHS_PROVIDED_TO_FRONTEND', ('test_path/*', 'path/to/file.js')):
        hashes = {'path/to/file.js': '123456', 'test_path/to/file.html': '123456', 'test_path/to/file.js': 'abcdef', 'path/path/file.js': 'zyx123', 'file.html': '321xyz'}
        filtered_hashes = build.filter_hashes(hashes)
        self.assertTrue(filtered_hashes.has_key('/path/to/file.js'))
        self.assertTrue(filtered_hashes.has_key('/test_path/to/file.html'))
        self.assertTrue(filtered_hashes.has_key('/test_path/to/file.js'))
        self.assertFalse(filtered_hashes.has_key('/path/path/file.js'))
        self.assertFalse(filtered_hashes.has_key('/file.html'))
Test filter_hashes filters the provided hash correctly.
def test_filter_hashes(self):
    
    with self.swap(build, 'FILEPATHS_PROVIDED_TO_FRONTEND', ('*',)):
        hashes = {'path/to/file.js': '123456', 'path/file.min.js': '123456'}
        filtered_hashes = build.filter_hashes(hashes)
        self.assertEqual(filtered_hashes['/path/to/file.js'], hashes['path/to/file.js'])
        self.assertEqual(filtered_hashes['/path/file.min.js'], hashes['path/file.min.js'])
    with self.swap(build, 'FILEPATHS_PROVIDED_TO_FRONTEND', ('test_path/*', 'path/to/file.js')):
        hashes = {'path/to/file.js': '123456', 'test_path/to/file.html': '123456', 'test_path/to/file.js': 'abcdef', 'path/path/file.js': 'zyx123', 'file.html': '321xyz'}
        filtered_hashes = build.filter_hashes(hashes)
        self.assertTrue(filtered_hashes.has_key('/path/to/file.js'))
        self.assertTrue(filtered_hashes.has_key('/test_path/to/file.html'))
        self.assertTrue(filtered_hashes.has_key('/test_path/to/file.js'))
        self.assertFalse(filtered_hashes.has_key('/path/path/file.js'))
        self.assertFalse(filtered_hashes.has_key('/file.html'))