Commits

Jonathan Eunice  committed 727ce01

added tests

  • Participants
  • Parent commits cdc78a8

Comments (0)

Files changed (4)

+from richxerox import *

File richxerox.py

         else:
             print item_text
     
-def test_richxerox():
+def demo_richxerox():
     """
     Let's try it out!
     """
     dict_print(pasteall(), 'AFTER COPY')
     
 if __name__ == '__main__':
-    test_richxerox()
+    demo_richxerox()
 
 setup(
     name='richxerox',
-    version='0.11',
+    version='0.12',
     author='Jonathan Eunice',
     author_email='jonathan.eunice@gmail.com',
     description='copy/paste for Mac OS X for rich text (HTML/RTF) rather than plain text',
+
+from richxerox import *
+
+def test_clear():
+
+    clear()
+    assert available() == []
+    assert list(pasteall().keys()) == []
+    
+def test_copypaste():
+    t0 = "this is good!"
+    h0 = "this is <strong>good</strong>!"
+
+    copy(text=t0, html=h0)
+    t = paste()
+    assert t == t0
+    
+    h = paste('html')
+    assert h == h0
+    
+    assert len(pasteall().keys()) == 2
+    
+if __name__ == '__main__':
+    test_clear()
+    test_copypaste()