Beispiel #1
0
    def test_equality(self, track_short_old):
        a = PlayContext(self.client_, self.context, self.context_item, [track_short_old])
        b = PlayContext('', self.context, self.context_item, [])
        c = PlayContext(self.client_, self.context, self.context_item, [track_short_old])

        assert a != b
        assert hash(a) != hash(b)
        assert a is not b

        assert a == c
Beispiel #2
0
    def test_de_json_all(self, client, track_short_old):
        json_dict = {
            'client_': self.client_,
            'context': self.context,
            'context_item': self.context_item,
            'tracks': [track_short_old.to_dict()],
        }
        play_context = PlayContext.de_json(json_dict, client)

        assert play_context.client_ == self.client_
        assert play_context.context == self.context
        assert play_context.context_item == self.context_item
        assert play_context.tracks == [track_short_old]
Beispiel #3
0
def play_context(track_short_old):
    return PlayContext(TestPlayContext.client_, TestPlayContext.context,
                       TestPlayContext.context_item, [track_short_old])
Beispiel #4
0
 def test_de_json_none(self, client):
     assert PlayContext.de_json({}, client) is None