# Path: ice/gridproviders/local_provider.py
# class LocalProvider(grid_image_provider.GridImageProvider):
# 
#   def valid_extensions(self):
#     return ['.png', '.jpg', '.jpeg', '.tiff']
# 
#   def image_for_rom(self, rom):
#     """
#     Checks the filesystem for images for a given ROM. To do so, it makes
#     use of a consoles 'images' directory. If it finds an image in that
#     directory with the same name as the ROMs name then it will return that.
#     """
#     img_dir = rom.console.images_directory
#     if img_dir == "":
#       logger.debug(
#         "[%s] No images directory specified for %s" %
#         (rom.name, rom.console.shortname)
#       )
#       return None
#     for extension in self.valid_extensions():
#       filename = rom.name + extension
#       path = os.path.join(img_dir, filename)
#       if os.path.isfile(path):
#         # We found a valid path, return it
#         return path
#     # We went through all of the possible filenames for this ROM and a
#     # file didnt exist with any of them. There is no image for this ROM in
#     # the consoles image directory
#     return None


from mockito import *
from ice.gridproviders.local_provider import LocalProvider
import os
import shutil
import tempfile
import unittest
# encoding: utf-8
"""
local_provider_tests.py

Created by Scott on 2014-08-18.
Copyright (c) 2014 Scott Rice. All rights reserved.
"""




class LocalProviderTests(unittest.TestCase):

  def setUp(self):

# Path: ice/gridproviders/local_provider.py
# class LocalProvider(grid_image_provider.GridImageProvider):
# 
#   def valid_extensions(self):
#     return ['.png', '.jpg', '.jpeg', '.tiff']
# 
#   def image_for_rom(self, rom):
#     """
#     Checks the filesystem for images for a given ROM. To do so, it makes
#     use of a consoles 'images' directory. If it finds an image in that
#     directory with the same name as the ROMs name then it will return that.
#     """
#     img_dir = rom.console.images_directory
#     if img_dir == "":
#       logger.debug(
#         "[%s] No images directory specified for %s" %
#         (rom.name, rom.console.shortname)
#       )
#       return None
#     for extension in self.valid_extensions():
#       filename = rom.name + extension
#       path = os.path.join(img_dir, filename)
#       if os.path.isfile(path):
#         # We found a valid path, return it
#         return path
#     # We went through all of the possible filenames for this ROM and a
#     # file didnt exist with any of them. There is no image for this ROM in
#     # the consoles image directory
#     return None


# Path: tests/local_provider_tests.py
from mockito import *
from ice.gridproviders.local_provider import LocalProvider
import os
import shutil
import tempfile
import unittest

# encoding: utf-8
"""
local_provider_tests.py

Created by Scott on 2014-08-18.
Copyright (c) 2014 Scott Rice. All rights reserved.
"""




class LocalProviderTests(unittest.TestCase):

  def setUp(self):

    self.provider = LocalProvider()