Kashyap Maduri
commited on
Commit
·
6ffef98
1
Parent(s):
4f32aa1
adding test around create youtube object from a url. Added a test file for testing on python3
Browse files- tests/test_p3_pytube.py +18 -0
- tests/test_pytube.py +6 -0
tests/test_p3_pytube.py
ADDED
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
#!/usr/bin/env python3
|
2 |
+
# -*- coding: utf-8 -*-
|
3 |
+
from __future__ import unicode_literals
|
4 |
+
import warnings
|
5 |
+
import mock
|
6 |
+
from nose.tools import eq_, raises
|
7 |
+
from pytube import api
|
8 |
+
from pytube.exceptions import MultipleObjectsReturned, AgeRestricted, \
|
9 |
+
DoesNotExist, PytubeError
|
10 |
+
|
11 |
+
|
12 |
+
class TestPytube(object):
|
13 |
+
def setUp(self):
|
14 |
+
self.url = 'http://www.youtube.com/watch?v=9bZkp7q19f0'
|
15 |
+
|
16 |
+
def test_YT_create_from_url(self):
|
17 |
+
'test creation of YouYube Object from url'
|
18 |
+
yt = api.YouTube(self.url)
|
tests/test_pytube.py
CHANGED
@@ -132,3 +132,9 @@ class TestPytube(object):
|
|
132 |
def test_get_json_offset_with_bad_html(self):
|
133 |
"""Raise exception if json offset cannot be found"""
|
134 |
self.yt._get_json_offset('asdfasdf')
|
|
|
|
|
|
|
|
|
|
|
|
|
|
132 |
def test_get_json_offset_with_bad_html(self):
|
133 |
"""Raise exception if json offset cannot be found"""
|
134 |
self.yt._get_json_offset('asdfasdf')
|
135 |
+
|
136 |
+
def test_YT_create_from_url(self):
|
137 |
+
'test creation of YouYube Object from url'
|
138 |
+
url = 'http://www.youtube.com/watch?v=9bZkp7q19f0'
|
139 |
+
|
140 |
+
yt = api.YouTube(url)
|