Mattwmaster58
commited on
Commit
·
0649fcc
1
Parent(s):
bfad7f8
autopep8
Browse files- tests/test_query.py +24 -21
tests/test_query.py
CHANGED
@@ -68,9 +68,9 @@ def test_order_by(cipher_signature):
|
|
68 |
"""
|
69 |
itags = [
|
70 |
s.itag for s in cipher_signature.streams
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
]
|
75 |
|
76 |
assert itags == ['17', '18', '22', '36', '43']
|
@@ -83,22 +83,24 @@ def test_order_by_descending(cipher_signature):
|
|
83 |
# numerical values
|
84 |
itags = [
|
85 |
s.itag for s in cipher_signature.streams
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
]
|
91 |
assert itags == ['43', '36', '22', '18', '17']
|
92 |
|
93 |
# non numerical values
|
94 |
mime_types = [
|
95 |
s.mime_type for s in cipher_signature.streams
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
]
|
101 |
-
assert mime_types == ['video/webm', 'video/mp4',
|
|
|
|
|
102 |
|
103 |
def test_order_by_ascending(cipher_signature):
|
104 |
"""Ensure :meth:`~pytube.StreamQuery.desc` sorts the list of
|
@@ -107,10 +109,10 @@ def test_order_by_ascending(cipher_signature):
|
|
107 |
# numerical values
|
108 |
itags = [
|
109 |
s.itag for s in cipher_signature.streams
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
]
|
115 |
|
116 |
assert itags == ['17', '18', '22', '36', '43']
|
@@ -118,12 +120,13 @@ def test_order_by_ascending(cipher_signature):
|
|
118 |
# non numerical values
|
119 |
mime_types = [
|
120 |
s.mime_type for s in cipher_signature.streams
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
]
|
126 |
-
assert mime_types == ['video/3gpp', 'video/3gpp',
|
|
|
127 |
|
128 |
|
129 |
def test_get_by_itag(cipher_signature):
|
|
|
68 |
"""
|
69 |
itags = [
|
70 |
s.itag for s in cipher_signature.streams
|
71 |
+
.filter(progressive=True)
|
72 |
+
.order_by('itag')
|
73 |
+
.all()
|
74 |
]
|
75 |
|
76 |
assert itags == ['17', '18', '22', '36', '43']
|
|
|
83 |
# numerical values
|
84 |
itags = [
|
85 |
s.itag for s in cipher_signature.streams
|
86 |
+
.filter(progressive=True)
|
87 |
+
.order_by('itag')
|
88 |
+
.desc()
|
89 |
+
.all()
|
90 |
]
|
91 |
assert itags == ['43', '36', '22', '18', '17']
|
92 |
|
93 |
# non numerical values
|
94 |
mime_types = [
|
95 |
s.mime_type for s in cipher_signature.streams
|
96 |
+
.filter(progressive=True)
|
97 |
+
.order_by('mime_type')
|
98 |
+
.desc()
|
99 |
+
.all()
|
100 |
]
|
101 |
+
assert mime_types == ['video/webm', 'video/mp4',
|
102 |
+
'video/mp4', 'video/3gpp', 'video/3gpp']
|
103 |
+
|
104 |
|
105 |
def test_order_by_ascending(cipher_signature):
|
106 |
"""Ensure :meth:`~pytube.StreamQuery.desc` sorts the list of
|
|
|
109 |
# numerical values
|
110 |
itags = [
|
111 |
s.itag for s in cipher_signature.streams
|
112 |
+
.filter(progressive=True)
|
113 |
+
.order_by('itag')
|
114 |
+
.asc()
|
115 |
+
.all()
|
116 |
]
|
117 |
|
118 |
assert itags == ['17', '18', '22', '36', '43']
|
|
|
120 |
# non numerical values
|
121 |
mime_types = [
|
122 |
s.mime_type for s in cipher_signature.streams
|
123 |
+
.filter(progressive=True)
|
124 |
+
.order_by('mime_type')
|
125 |
+
.asc()
|
126 |
+
.all()
|
127 |
]
|
128 |
+
assert mime_types == ['video/3gpp', 'video/3gpp',
|
129 |
+
'video/mp4', 'video/mp4', 'video/webm']
|
130 |
|
131 |
|
132 |
def test_get_by_itag(cipher_signature):
|