class TestEpisodeNamesFinder(TestCase):
  def setUp(self):
    self.sut = EpisodesNameFinder()
    shutil.copy(EPISODE_TEST_FILE,EPISODE_FILE)

  def tearDown(self):
    self.sut = None
    os.remove(EPISODE_FILE)

  def test_load_episodes_name(self):
    names = self.sut.load_episodes_name()
    self.assertEqual(len(names),8)
    self.assertTrue((1,2) in names)
    self.assertEqual(names[(1,2)], "Test episode name")
    self.assertTrue((2,4) in names)
    self.assertEqual(names[(2,4)], "Test episode name 2")
    self.assertTrue((2,5) in names)
    self.assertEqual(names[(2,5)], "Episode name 5")
    self.assertTrue((2,7) in names)
    self.assertEqual(names[(2,7)], "Episode's name 7")
    self.assertTrue((2,6) in names)
    self.assertEqual(names[(2,6)], "Title episode 6")
    self.assertTrue((-1,6) in names)
    self.assertEqual(names[(-1,6)], "Spirit of the Goat")
    self.assertTrue((-1,7) in names)
    self.assertEqual(names[(-1,7)], "Penguin's Umbrella")
    self.assertTrue((-1,1) in names)
    self.assertEqual("The Fallen Star of a Contract... (Part 1)", names[(-1,1)])

  def test_parse_episode_name_line(self):
    line = '1 "The Fallen Star of a Contract... (Part 1)"'
    season, episode, name = self.sut.parse_episode_name_line(line)
    self.assertEqual(-1, season)
    self.assertEqual(1, episode)
    self.assertEqual("The Fallen Star of a Contract... (Part 1)", name)
 def setUp(self):
   self.sut = EpisodesNameFinder()
   shutil.copy(EPISODE_TEST_FILE,EPISODE_FILE)