Created
April 19, 2009 15:29
-
-
Save mrkurt/98101 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class TestRunner(unittest.TestCase): | |
def test_simple_js(self): | |
result = Runner().run_js('"kurt rocks";') | |
self.assertEqual(result, 'kurt rocks') | |
def test_longer_js(self): | |
result = Runner().run_js('var blah = "kurt rocks";\nblah;') | |
self.assertEqual(result, 'kurt rocks') | |
def test_complex_return(self): | |
result = Runner().run_js('var complex = { "kurt" : "rocks", "when" : ["mon", "tues", "fri"] };\ncomplex;') | |
self.assertEqual(result.kurt, "rocks") | |
self.assertEqual(len(result.when), 3) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment