示例#1
0
    def fixture():
        _.internal_class = Internal
        _.hash = '204939024023840234'

        _.hasher = mock()
        when(_.hasher).hash(any(unicode)).thenReturn(_.hash)

        _.track_data = {
            'userdata': {},
            'track_nr': 2,
            'title': 'The Title',
            'album': None,
            'artist': 'The Artist'
        }
        _.track = Track(Internal(_.track_data), hasher=_.hasher)
        _.fabricated_track = Track.create(_.track_data,
                                          internal_class=_.internal_class)
示例#2
0
    def fixture():
        _.internal_class = Internal
        _.hash = "204939024023840234"

        _.hasher = mock()
        when(_.hasher).hash(any(unicode)).thenReturn(_.hash)

        _.track_data = {"userdata": {}, "track_nr": 2, "title": "The Title", "album": None, "artist": "The Artist"}
        _.track = Track(Internal(_.track_data), hasher=_.hasher)
        _.fabricated_track = Track.create(_.track_data, internal_class=_.internal_class)
示例#3
0
 def create_track(**kwargs):
     data = dict(_.track_data)
     data.update(kwargs)
     return Track.create(data, internal_class=_.internal_class)
示例#4
0
 def create_track(**kwargs):
     data = dict(_.track_data)
     data.update(kwargs)
     return Track.create(data, internal_class=_.internal_class)