# Path: ice/backups.py
# def default_backups_directory():
# def backup_filename(user, timestamp_format):
# def shortcuts_backup_path(directory, user, timestamp_format="%Y%m%d%H%M%S"):
# def backup_directory(config):
# def create_backup_of_shortcuts(config, user, dry_run=False):
#   def _create_directory_if_needed(directory):
# 
# Path: ice/paths.py
# def application_data_directory():
# def data_file_path(filename):
# def archive_path():
# def log_file_location():
# def default_roms_directory():


import os
import shutil
import tempfile
import unittest
from mockito import *
from nose_parameterized import parameterized
from pysteam import model
from pysteam import shortcuts
from ice import backups
from ice import paths
from testinfra import fixtures








class BackupsTests(unittest.TestCase):

  def setUp(self):
    self.steam_fixture = fixtures.SteamFixture()
    self.user_fixture = fixtures.UserFixture(self.steam_fixture)

  @parameterized.expand([
    (None, None),
    ("", backups.default_backups_directory()),
    ("/some/random/dir", "/some/random/dir"),
  ])
  def test_backup_directory(self, config_backups_dir, expected_dir):
    config = mock()
    config.backup_directory = config_backups_dir


# Path: ice/backups.py
# def default_backups_directory():
# def backup_filename(user, timestamp_format):
# def shortcuts_backup_path(directory, user, timestamp_format="%Y%m%d%H%M%S"):
# def backup_directory(config):
# def create_backup_of_shortcuts(config, user, dry_run=False):
#   def _create_directory_if_needed(directory):
# 
# 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: tests/backups_tests.py
import os
import shutil
import tempfile
import unittest
from mockito import *
from nose_parameterized import parameterized
from pysteam import model
from pysteam import shortcuts
from ice import backups
from ice import paths
from testinfra import fixtures









class BackupsTests(unittest.TestCase):

  def setUp(self):
    self.steam_fixture = fixtures.SteamFixture()
    self.user_fixture = fixtures.UserFixture(self.steam_fixture)

  @parameterized.expand([
    (None, None),
    ("", backups.default_backups_directory()),
    ("/some/random/dir", "/some/random/dir"),
  ])
  def test_backup_directory(self, config_backups_dir, expected_dir):
    config = mock()
    config.backup_directory = config_backups_dir


    self.assertEqual(backups.backup_directory(config), expected_dir)