Retroactive TDD! :-P

This commit is contained in:
Dan Buch 2012-02-06 09:50:03 -05:00
parent c4122c3643
commit 89393c390f
3 changed files with 24 additions and 0 deletions

View File

@ -12,6 +12,7 @@ __meta__ = dict(
'flickrscripts = flickrscripts:route', 'flickrscripts = flickrscripts:route',
], ],
}, },
test_suite='nose.collector',
) )
USAGE = 'Usage: {prog} <subcommand> [args]' USAGE = 'Usage: {prog} <subcommand> [args]'

View File

@ -41,5 +41,9 @@ def get_flickr_from_rc_file(rc_file=expanduser('~/.flickrscripts.json')):
return setup_flickr(rc_conf['APIKEY'], rc_conf['APISECRET']) return setup_flickr(rc_conf['APIKEY'], rc_conf['APISECRET'])
def load_rc_file(rc_file=expanduser('~/.flickrscripts.json')):
return json.load(open(rc_file))
class InvalidPhotoIdError(ValueError): class InvalidPhotoIdError(ValueError):
pass pass

19
tests/itest_timewarp.py Normal file
View File

@ -0,0 +1,19 @@
import unittest
from flickrscripts.timewarp import TimeWarper
from flickrscripts.common import load_rc_file
class TimeWarperTestCase(unittest.TestCase):
def setUp(self):
rc_conf = load_rc_file()
self.warper = TimeWarper(rc_conf['APIKEY'], rc_conf['APISECRET'])
def test_is_not_horribly_busted(self):
self.assertTrue(True, 'please forgive the horrible test')
if __name__ == '__main__':
unittest.main()