gnome-applets r11110 - trunk/invest-applet/invest
- From: callum svn gnome org
- To: svn-commits-list gnome org
- Subject: gnome-applets r11110 - trunk/invest-applet/invest
- Date: Sat, 8 Nov 2008 01:50:59 +0000 (UTC)
Author: callum
Date: Sat Nov 8 01:50:58 2008
New Revision: 11110
URL: http://svn.gnome.org/viewvc/gnome-applets?rev=11110&view=rev
Log:
Insert a pre-prepared stock list so we no longer
need to have run the invest applet before running the tests.
Modified:
trunk/invest-applet/invest/test.py
Modified: trunk/invest-applet/invest/test.py
==============================================================================
--- trunk/invest-applet/invest/test.py (original)
+++ trunk/invest-applet/invest/test.py Sat Nov 8 01:50:58 2008
@@ -5,25 +5,14 @@
import quotes
import invest
-print """=====================================================================
-Please note that these tests will fail if you do not have any stocks
-already set up in the applet. This is an unfortunate state of affairs
-that we hope to have fixed in the near future. For now, please run
-the applet and enter at least one stock to be monitored. The default
-is just fine.
-====================================================================="""
-
def null_function (*args):
pass
class TestQuotes (unittest.TestCase):
def testQuoteUpdater_populate (self):
qu = quotes.QuoteUpdater (null_function, null_function)
- # We require a pre-created invest.STOCKS for the moment (since
- # the quotes module will load the real database). Pick the first
- # stock as the one we test.
- goodname = invest.STOCKS.keys()[0]
- quote = { goodname: { "ticker": goodname, "trade": 386.91, "time": "10/3/2008", "date": "4.00pm", "variation": -3.58, "open": 397.14, "variation_pct": 10 }}
+ invest.STOCKS = {'GOGO': [{'amount' : 1, 'comission' : 0.0, 'bought': 0.0}], 'JAVA': [{'amount' : 1, 'comission' : 0.0, 'bought': 0.0}]}
+ quote = { 'GOGO': { "ticker": 'GOGO', "trade": 386.91, "time": "10/3/2008", "date": "4.00pm", "variation": -3.58, "open": 397.14, "variation_pct": 10 }}
qu.populate (quote)
self.assertEqual (qu.quotes_valid, True)
# In response to bug 554425, try a stock that isn't in our database
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]