Mike takes to heart the adage that ideas are f***ing worthless without action.

Saturday, July 25, 2009

getting back into it... day 2

I've downloaded and installed TortiseHg for Windows (I'm running XP on my netbook) and I've done my first few tests with it... it's pretty nice. I've used TortiseSVN in the past, so I kind of knew what to expect. I chose TortiseHg and Mercurial because it's the version control system that Python is going to use in the future, so that's good enough for me. I don't have the experience or time to get it, so I'm going with the crowd on this one for now.

I added some test cases, now my code doesn't pass. Here's the current version of the testing unit:


"""Unit test for translate01.py"""

import translate01
import unittest

class KnownValues(unittest.TestCase):
knownValues = ( ( '', ''),
( 'x','x'),
( '>','>'),
( '<','<') )
def testToHtmlKnownValues(self):
"""ToHtml should give known results with known input"""
for s1,s2 in self.knownValues:
result = translate01.toHtml(s1)
self.assertEqual(s2,result)
def testFromHtmlKnownValues(self):
"""FromHtml should give known results with known input"""
for s1,s2 in self.knownValues:
result = translate01.fromHtml(s2)
self.assertEqual(s1,result)


if __name__ == "__main__":
unittest.main()

No comments:

About Me

My photo
Munster, Indiana, United States
I fix things, I take pictures, I write, and marvel at the joy of life. I'm trying to leave the world in better condition than when I found it.