1. Jason R. Coombs
  2. pyv8

Commits

flie...@3b770cb8-f9e6-11dd-ac5b-dfceb64ead24  committed bf1e27e

move PyV8 to root folder

  • Participants
  • Parent commits 14b99b0
  • Branches default

Comments (0)

Files changed (2)

File PyV8.py

View file
  • Ignore whitespace
+#!/usr/bin/env python
+import _PyV8
+
+Engine = _PyV8.Engine
+
+import unittest
+
+class TestEngine(unittest.TestCase):
+    def testClassProperties(self):
+        self.assertEquals("1.0.1", Engine.version)
+        
+    def testCompile(self):
+        engine = Engine()
+        
+        try:
+            s = engine.compile("1+2")
+            
+            self.assertEquals("1+2", s.source)
+            self.assertEquals("3", s.run())
+        finally:
+            del engine
+            
+    def testExec(self):
+        engine = Engine()
+        
+        try:
+            self.assertEquals("3", engine.eval("1+2"))
+        finally:
+            del engine
+            
+    def testGlobal(self):
+        class Global(object):
+            version = "1.0"
+            
+        context = Global()
+        engine = Engine(context)
+        
+        try:
+            self.assertEquals(Global.version, engine.eval("version"))
+        finally:
+            del engine
+
+if __name__ == '__main__':
+    unittest.main()

File src/PyV8.py

  • Ignore whitespace
-#!/usr/bin/env python
-import _PyV8
-
-Engine = _PyV8.Engine
-
-import unittest
-
-class TestEngine(unittest.TestCase):
-    def testClassProperties(self):
-        self.assertEquals("1.0.1", Engine.version)
-        
-    def testCompile(self):
-        engine = Engine()
-        
-        try:
-            s = engine.compile("1+2")
-            
-            self.assertEquals("1+2", s.source)
-            self.assertEquals("3", s.run())
-        finally:
-            del engine
-            
-    def testExec(self):
-        engine = Engine()
-        
-        try:
-            self.assertEquals("3", engine.eval("1+2"))
-        finally:
-            del engine
-            
-    def testGlobal(self):
-        class Global(object):
-            version = "1.0"
-            
-        context = Global()
-        engine = Engine(context)
-        
-        try:
-            self.assertEquals(Global.version, engine.eval("version"))
-        finally:
-            del engine
-
-if __name__ == '__main__':
-    unittest.main()