From 5f087f0efafc5b6c291e829fde6b333479a622b3 Mon Sep 17 00:00:00 2001 From: Olof Johansson Date: Sat, 8 Sep 2018 22:21:54 +0200 Subject: [PATCH] protocol_prio: Make the test suite import module from right location The tests are still failing, but not from ImportError anymore. --- lib/svtplay_dl/tests/protocol_prio.py | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/lib/svtplay_dl/tests/protocol_prio.py b/lib/svtplay_dl/tests/protocol_prio.py index b2bc1d4..1e4247c 100644 --- a/lib/svtplay_dl/tests/protocol_prio.py +++ b/lib/svtplay_dl/tests/protocol_prio.py @@ -4,16 +4,14 @@ from __future__ import absolute_import import unittest -from svtplay_dl.utils import protocol_prio +from svtplay_dl.utils.stream import protocol_prio -class Stream(object): +class VideoRetriever(object): def __init__(self, proto, bitrate): self.proto = proto self.bitrate = bitrate - - def name(self): - return self.proto + self.name = proto def __repr__(self): return '%s(%d)' % (self.proto.upper(), self.bitrate) @@ -21,11 +19,11 @@ class Stream(object): class PrioStreamsTest(unittest.TestCase): def _gen_proto_case(self, ordered, unordered, expected=None): - streams = [Stream(x, 100) for x in unordered] + streams = [VideoRetriever(x, 100) for x in unordered] kwargs = {} if expected is None: - expected = [str(Stream(x, 100)) for x in ordered] + expected = [str(VideoRetriever(x, 100)) for x in ordered] return self.assertEqual( [str(x) for x in protocol_prio(streams, ordered, **kwargs)],