Skip to content

Commit

Permalink
Merge pull request #2 from PlasmaSheep/hotfix-encoding
Browse files Browse the repository at this point in the history
Hotfix encoding
  • Loading branch information
PlasmaSheep authored and PlasmaSheep committed Aug 17, 2014
2 parents ff484c3 + 4c1628a commit 4b2c306
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 30 deletions.
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
language: python
python:
- "3.4"
install: "pip install -r requirements.txt"
script: python runtests.py
install: "pip install -r requirements.txt; pip install -r requirements-testing.txt"
script: nosetests -v

2 changes: 0 additions & 2 deletions CONTRIBUTING.markdown

This file was deleted.

14 changes: 0 additions & 14 deletions runtests.py

This file was deleted.

1 change: 1 addition & 0 deletions selector.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ def get_backlog(self):

f = urllib.request.urlopen(RINSE_URL + str(info["id"]))
for line in f:
line = line.decode("utf-8")
if re.search(TRACK_RE, line):
all_eps.extend(re.findall(TRACK_RE, line))

Expand Down
24 changes: 12 additions & 12 deletions tests/testselector.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,18 +40,18 @@ def test_get_backlog(self, mock_urllib):

mock_file_iterator = MagicMock()
mock_file_iterator.__iter__.return_value = iter([
"foobar",
"foobaz",
('<a href='
'"http://podcast.dgen.net/rinsefm/podcast/FooBarBaz131211.mp3"'
'></a>'),
('<a href="http://podcast.dgen.net/rinsefm/podcast/'
'FooBarBaz090101.mp3"'
'download="http://podcast.dgen.net/rinsefm/podcast/'
'FooBarBaz090101.mp3" '
'target="_blank" class="bglavender"'
'title="Right Click and Save As to Download">&nbsp;</a>'
)])
b"foobar",
b"foobaz",
(b'<a href='
b'"http://podcast.dgen.net/rinsefm/podcast/FooBarBaz131211.mp3"'
b'></a>'),
(b'<a href="http://podcast.dgen.net/rinsefm/podcast/'
b'FooBarBaz090101.mp3"'
b'download="http://podcast.dgen.net/rinsefm/podcast/'
b'FooBarBaz090101.mp3" '
b'target="_blank" class="bglavender"'
b'title="Right Click and Save As to Download">&nbsp;</a>')])

mock_urllib.urlopen.return_value = mock_file_iterator
results = self.selector.get_backlog()

Expand Down

0 comments on commit 4b2c306

Please sign in to comment.