Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 387382 Details for
Bug 526862
x11-apps/variety - wallpaper changer, downloader and manager
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch 2
02_all_variety-0.4.20_tests-fixes.patch (text/plain), 5.75 KB, created by
Paweł Stankowski
on 2014-10-26 00:02:52 UTC
(
hide
)
Description:
Patch 2
Filename:
MIME Type:
Creator:
Paweł Stankowski
Created:
2014-10-26 00:02:52 UTC
Size:
5.75 KB
patch
obsolete
># This patch contains fixes for files that were not resolved in upstream repository. ># It was sent upstream, so hopefully won't be needed for future versions. > >=== modified file 'tests/TestUtil.py' >--- tests/TestJumble.py 2014-10-23 02:33:26.849283179 +0200 >+++ tests/TestJumble.py 2014-10-23 02:26:21.841396700 +0200 >@@ -25,10 +25,26 @@ > sys.path.insert(0, os.path.realpath(os.path.join(os.path.dirname(__file__), ".."))) > > class P1(IPlugin): >- pass >+ @classmethod >+ def get_info(cls): >+ return { >+ "name": "Sample name", >+ "description": "Sample description", >+ "version": "1.0", >+ "author": "Author name", # optional >+ "url": "Plugin URL" # optional >+ } > > class P2(IQuoteSource): >- pass >+ @classmethod >+ def get_info(cls): >+ return { >+ "name": "Sample name 2", >+ "description": "Sample description 2", >+ "version": "2.0", >+ "author": "Author name 2", # optional >+ "url": "Plugin URL 2" # optional >+ } > > > class TestJumble(unittest.TestCase): >=== modified file 'tests/TestUtil.py' >--- tests/TestUtil.py 2013-09-24 20:55:52 +0000 >+++ tests/TestUtil.py 2014-10-25 00:33:17 +0000 >@@ -19,6 +19,7 @@ > import os.path > import unittest > from variety.Util import Util >+from gi.repository import GLib > > sys.path.insert(0, os.path.realpath(os.path.join(os.path.dirname(__file__), ".."))) > >@@ -62,7 +63,7 @@ > > def test_find_unique_name(self): > self.assertEquals('/etc/fstab_1', Util.find_unique_name('/etc/fstab')) >- self.assertEquals('/etc/bash_1.bashrc', Util.find_unique_name('/etc/bash.bashrc')) >+ self.assertEquals('TestUtil_1.py', Util.find_unique_name('TestUtil.py')) > > def test_folderpath(self): > self.assertEquals("/", Util.folderpath("/")) >@@ -97,7 +98,7 @@ > self.assertEquals("a32377b309e3230f3c89c455ef1bdf0b", Util.md5file("test.jpg")) > > def test_collapseuser(self): >- self.assertEquals("~/.config/variety", Util.collapseuser("/home/peter/.config/variety")) >+ self.assertEquals("~/.config/variety", Util.collapseuser(os.environ['HOME'] + "/.config/variety")) > self.assertEquals("/home/peteraaa/.config/variety", Util.collapseuser("/home/peteraaa/.config/variety")) > self.assertEquals("/media/.config/variety", Util.collapseuser("/media/.config/variety")) > >@@ -110,10 +111,10 @@ > def test_get_file_icon_name(self): > self.assertEquals("folder", Util.get_file_icon_name("/xxx/yyy/zzz")) # nonexistent > self.assertEquals("user-home", Util.get_file_icon_name("~")) >- self.assertEquals("folder-pictures", Util.get_file_icon_name("~/Pictures")) >- >- def test_get_xdg_pictures_folder(self): >- self.assertEquals(os.path.expanduser('~/Pictures'), Util.get_xdg_pictures_folder()) >+ pictures_directory=GLib.get_user_special_dir(GLib.USER_DIRECTORY_PICTURES) >+ # Test proper icon reading of 'Pictures' folder only if one exists for current user >+ if not pictures_directory is None: >+ self.assertEquals("folder-pictures", Util.get_file_icon_name(pictures_directory)) > > def test_safe_map(self): > def f(i): > >=== modified file 'data/plugins/quotes/QuotesDaddySource.py' >--- data/plugins/quotes/QuotesDaddySource.py 2014-07-06 19:33:36 +0000 >+++ data/plugins/quotes/QuotesDaddySource.py 2014-10-25 23:29:28 +0000 >@@ -24,6 +24,13 @@ > > > class QuotesDaddySource(IQuoteSource): >+ def __init__(self): >+ super(QuotesDaddySource,self).__init__() >+ self.url = "http://www.quotesdaddy.com/feed" >+ >+ def set_url(self, url): >+ self.url = url >+ > @classmethod > def get_info(cls): > return { >@@ -38,9 +45,7 @@ > return False > > def get_random(self): >- url = "http://www.quotesdaddy.com/feed" >- >- bs = Util.xml_soup(url) >+ bs = Util.xml_soup(self.url) > item = bs.find("item") > if not item: > logger.warning("Could not find quotes for URL " + url) > >=== modified file 'tests/TestQuotesDaddySource.py' >--- tests/TestQuotesDaddySource.py 2013-09-24 21:08:15 +0000 >+++ tests/TestQuotesDaddySource.py 2014-10-25 23:30:14 +0000 >@@ -24,8 +24,10 @@ > > class TestQuotesDaddySource(unittest.TestCase): > def test_get_random(self): > p = Jumble(["../data/plugins"]) > p.load() > source = p.get_plugins(typename="QuotesDaddySource")[0] >- q = source["plugin"].get_random()[0] >+ p = source["plugin"] >+ p.set_url("file:///" + os.path.realpath(os.path.join(os.path.dirname(__file__), "test_quotes_feed.xml"))) >+ q = p.get_random()[0] > self.assertEqual("QuotesDaddy", q["sourceName"]) > >=== added file 'tests/test_quotes_feed.xml' >--- tests/test_quotes_feed.xml 1970-01-01 00:00:00 +0000 >+++ tests/test_quotes_feed.xml 2014-10-25 23:28:48 +0000 >@@ -0,0 +1,17 @@ >+<?xml version="1.0" encoding="UTF-8" ?> >+<rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/"> >+ <channel> >+ <title>Quotes Daddy - Quote of the Day</title> >+ <link>http://www.quotesdaddy.com/</link> >+ <description></description> >+ <pubDate>Sat, 25 Oct 2014 21:56:34 +0000</pubDate> >+ <language>en</language> >+ <item> >+ <title>"I am a success today because I had a friend who believed in me and I didn't have the heart to let him down..." - Abraham Lincoln</title> >+ <link>http://www.quotesdaddy.com/quote/288/abraham-lincoln/i-am-a-success-today-because-i-had-a-friend-who-believed</link> >+ <description>"I am a success today because I had a friend who believed in me and I didn't have the heart to let him down..." - Abraham Lincoln</description> >+ <guid isPermalink="false">288</guid> >+ <pubDate>Sat, 25 Oct 2014 21:56:34 +0000</pubDate> >+ </item> >+ </channel> >+</rss> >\ No newline at end of file >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 526862
:
387378
|
387380
| 387382 |
387384