def test_get_filepaths_by_extensions(self):
    'Test get_filepaths_by_extensions only returns filepaths in\n        directory with given extensions.\n        '
    filepaths = []
    build.ensure_directory_exists(MOCK_ASSETS_DEV_DIR)
    extensions = ('.json', '.svg')
    self.assertEqual(len(filepaths), 0)
    filepaths = build.get_filepaths_by_extensions(MOCK_ASSETS_DEV_DIR, extensions)
    for filepath in filepaths:
        self.assertTrue(any((filepath.endswith(p) for p in extensions)))
    file_count = 0
    for (_, _, filenames) in os.walk(MOCK_ASSETS_DEV_DIR):
        for filename in filenames:
            if any((filename.endswith(p) for p in extensions)):
                file_count += 1
    self.assertEqual(len(filepaths), file_count)
    filepaths = []
    extensions = ('.pdf', '.viminfo', '.idea')
    self.assertEqual(len(filepaths), 0)
    filepaths = build.get_filepaths_by_extensions(MOCK_ASSETS_DEV_DIR, extensions)
    self.assertEqual(len(filepaths), 0)
Test get_filepaths_by_extensions only returns filepaths in
directory with given extensions.
def test_get_filepaths_by_extensions(self):
    'Test get_filepaths_by_extensions only returns filepaths in\n        directory with given extensions.\n        '
    filepaths = []
    build.ensure_directory_exists(MOCK_ASSETS_DEV_DIR)
    extensions = ('.json', '.svg')
    self.assertEqual(len(filepaths), 0)
    filepaths = build.get_filepaths_by_extensions(MOCK_ASSETS_DEV_DIR, extensions)
    for filepath in filepaths:
        self.assertTrue(any((filepath.endswith(p) for p in extensions)))
    file_count = 0
    for (_, _, filenames) in os.walk(MOCK_ASSETS_DEV_DIR):
        for filename in filenames:
            if any((filename.endswith(p) for p in extensions)):
                file_count += 1
    self.assertEqual(len(filepaths), file_count)
    filepaths = []
    extensions = ('.pdf', '.viminfo', '.idea')
    self.assertEqual(len(filepaths), 0)
    filepaths = build.get_filepaths_by_extensions(MOCK_ASSETS_DEV_DIR, extensions)
    self.assertEqual(len(filepaths), 0)