# Path: ice/model.py
# ROM = collections.namedtuple('ROM', [
#   'name',
#   'path',
#   'console',
# ])
# 
# Path: ice/paths.py
# def application_data_directory():
# def data_file_path(filename):
# def archive_path():
# def log_file_location():
# def default_roms_directory():
# 
# Path: ice/roms.py
# ICE_FLAG_TAG = "~ManagedByIce"
# def roms_directory(config):
# def rom_shortcut_name(rom):
# def rom_to_shortcut(rom):


import os
import shutil
import tempfile
import unittest
from mockito import *
from nose_parameterized import parameterized
from pysteam import model as steam_model
from ice import model
from ice import paths
from ice import roms
from testinfra import fixtures

  def setUp(self):
    pass

  @parameterized.expand([
    (None, paths.default_roms_directory()),
    ("", paths.default_roms_directory()),
    ('/roms/', '/roms/'),
  ])
  def test_roms_directory(self, config_directory, expected):
    config = mock()
    config.roms_directory = config_directory
    self.assertEqual(roms.roms_directory(config), expected)

  @parameterized.expand([
    ('Banjo Kazoomie', None, 'Banjo Kazoomie'),
    ('Banjo Kazoomie', '[Vapor]', '[Vapor] Banjo Kazoomie'),
    ('Game Name', '!Something!', '!Something! Game Name'),
  ])
  def test_rom_shortcut_name(self, name, console_prefix, expected):
    console = model.Console(
      fullname = 'Nintendo Entertainment System',
      shortname = 'NES',
      extensions = '',
      custom_roms_directory = '',
      prefix = console_prefix,
      icon = '',
      images_directory = '',
      emulator = None,
    )

# Path: ice/model.py
# ROM = collections.namedtuple('ROM', [
#   'name',
#   'path',
#   'console',
# ])
# 
# Path: ice/paths.py
# def application_data_directory():
# def data_file_path(filename):
# def archive_path():
# def log_file_location():
# def default_roms_directory():
# 
# Path: ice/roms.py
# ICE_FLAG_TAG = "~ManagedByIce"
# def roms_directory(config):
# def rom_shortcut_name(rom):
# def rom_to_shortcut(rom):


# Path: tests/roms_tests.py
import os
import shutil
import tempfile
import unittest
from mockito import *
from nose_parameterized import parameterized
from pysteam import model as steam_model
from ice import model
from ice import paths
from ice import roms
from testinfra import fixtures


  def setUp(self):
    pass

  @parameterized.expand([
    (None, paths.default_roms_directory()),
    ("", paths.default_roms_directory()),
    ('/roms/', '/roms/'),
  ])
  def test_roms_directory(self, config_directory, expected):
    config = mock()
    config.roms_directory = config_directory
    self.assertEqual(roms.roms_directory(config), expected)

  @parameterized.expand([
    ('Banjo Kazoomie', None, 'Banjo Kazoomie'),
    ('Banjo Kazoomie', '[Vapor]', '[Vapor] Banjo Kazoomie'),
    ('Game Name', '!Something!', '!Something! Game Name'),
  ])
  def test_rom_shortcut_name(self, name, console_prefix, expected):
    console = model.Console(
      fullname = 'Nintendo Entertainment System',
      shortname = 'NES',
      extensions = '',
      custom_roms_directory = '',
      prefix = console_prefix,
      icon = '',
      images_directory = '',
      emulator = None,
    )

    rom = model.ROM(