# Path: chirp/library/album.py
# class AlbumError(Exception):
# class Album(object):
# def _compute_album_id(all_au_files):
# def _standardize_tags(all_au_files, new_album_name=None):
#     def __init__(self, all_au_files):
#     def _sort(self):
#     def standardize(self, new_album_name=None):
#     def set_volume_and_import_timestamp(self, vol, imp_ts):
#     def drop_payloads(self):
#     def ensure_payloads(self):
#     def title(self):
#     def tags(self):
#     def _get_tpe1_breakdown(self):
#     def is_compilation(self):
#     def artist_name(self):
#     def all_artist_names():
#     def import_timestamp(self):
#     def __str__(self):
# def from_directory(dirpath, fast=False):
# 
# Path: chirp/library/audio_file.py
# class AudioFile(object):
#     def __eq__(self, other):
#         def _mutagen_id3_set(obj):
#     def has_ufid(self):
#     def ufid(self):
#     def ufid_tag(self):
#     def tpe1(self):
#     def talb(self):
#     def tit2(self):
#     def canonical_directory(self, prefix=""):
#     def canonical_filename(self):
#     def canonical_path(self, prefix=""):
# def _get_mp3(path):
# def _tag_to_int(au_file, tag_key):
# def scan_fast(path, _read_id3_hook=None):
# def scan(path, _read_id3_hook=None):


import unittest
import mutagen.id3
from chirp.library import album
from chirp.library import audio_file





class AlbumTest(unittest.TestCase):

    def create_test_album(self, num_tracks):
        all_au_files = []        
        for i in range(1, num_tracks+1):
            au_file = audio_file.AudioFile()
            all_au_files.append(au_file)
            au_file.fingerprint = "%040x" % i
            au_file.mutagen_id3 = mutagen.id3.ID3()
            au_file.mutagen_id3.add(
                mutagen.id3.TPE1(text=["Fall, The"], encoding=3))
            au_file.mutagen_id3.add(
                mutagen.id3.TALB(text=["TALB [Tag]"], encoding=3))
            au_file.mutagen_id3.add(
                mutagen.id3.TIT2(text=["TIT2 [Tag]"], encoding=3))
            au_file.mutagen_id3.add(
                mutagen.id3.TRCK(text=["%d/%d" % (i, num_tracks)], encoding=3))
        return all_au_files

    create_test_album.__test__ = False  # not a test itself

    def test_standardize_tags(self):
        test_alb = self.create_test_album(4)

# Path: chirp/library/album.py
# class AlbumError(Exception):
# class Album(object):
# def _compute_album_id(all_au_files):
# def _standardize_tags(all_au_files, new_album_name=None):
#     def __init__(self, all_au_files):
#     def _sort(self):
#     def standardize(self, new_album_name=None):
#     def set_volume_and_import_timestamp(self, vol, imp_ts):
#     def drop_payloads(self):
#     def ensure_payloads(self):
#     def title(self):
#     def tags(self):
#     def _get_tpe1_breakdown(self):
#     def is_compilation(self):
#     def artist_name(self):
#     def all_artist_names():
#     def import_timestamp(self):
#     def __str__(self):
# def from_directory(dirpath, fast=False):
# 
# Path: chirp/library/audio_file.py
# class AudioFile(object):
#     def __eq__(self, other):
#         def _mutagen_id3_set(obj):
#     def has_ufid(self):
#     def ufid(self):
#     def ufid_tag(self):
#     def tpe1(self):
#     def talb(self):
#     def tit2(self):
#     def canonical_directory(self, prefix=""):
#     def canonical_filename(self):
#     def canonical_path(self, prefix=""):
# def _get_mp3(path):
# def _tag_to_int(au_file, tag_key):
# def scan_fast(path, _read_id3_hook=None):
# def scan(path, _read_id3_hook=None):


# Path: chirp/library/album_test.py
import unittest
import mutagen.id3
from chirp.library import album
from chirp.library import audio_file






class AlbumTest(unittest.TestCase):

    def create_test_album(self, num_tracks):
        all_au_files = []        
        for i in range(1, num_tracks+1):
            au_file = audio_file.AudioFile()
            all_au_files.append(au_file)
            au_file.fingerprint = "%040x" % i
            au_file.mutagen_id3 = mutagen.id3.ID3()
            au_file.mutagen_id3.add(
                mutagen.id3.TPE1(text=["Fall, The"], encoding=3))
            au_file.mutagen_id3.add(
                mutagen.id3.TALB(text=["TALB [Tag]"], encoding=3))
            au_file.mutagen_id3.add(
                mutagen.id3.TIT2(text=["TIT2 [Tag]"], encoding=3))
            au_file.mutagen_id3.add(
                mutagen.id3.TRCK(text=["%d/%d" % (i, num_tracks)], encoding=3))
        return all_au_files

    create_test_album.__test__ = False  # not a test itself

    def test_standardize_tags(self):
        test_alb = self.create_test_album(4)

        album._standardize_tags(test_alb)