summaryrefslogtreecommitdiff
path: root/dev-python/pweave/files/pweave-0.30.3-rm-online-tests.patch
blob: 3c5f1a227bec9e45d68a5a70d9427fc9cfb3e8a8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
diff --git a/tests/test_formatters.py b/tests/test_formatters.py
deleted file mode 100644
index 90cb45b..0000000
--- a/tests/test_formatters.py
+++ /dev/null
@@ -1,58 +0,0 @@
-import unittest
-import pweave
-import pickle
-import os
-
-class FormatterTest(unittest.TestCase):
-    """Test formatters"""
-
-
-    def setUp(self):
-        self.doc = pweave.Pweb("tests/formats/formatters_test.pmd")
-        self.doc.run()
-        #pickle.dump(self.doc.executed, open("tests/formats/formatters_test.pkl", "wb"))
-        with open("tests/formats/formatters_test.pkl", "rb") as f:
-            e = pickle.load(f)
-        self.doc.executed = e
-        self.out_base = "tests/formats/formatters_test.%s"
-        self.ref_base = "tests/formats/formatters_test_REF.%s"
-
-    def testFormatters(self):
-        formats = sorted(list(pweave.formatters.PwebFormats.formats.keys()))
-        for format in formats:
-            if "pandoc2latex" in format or "2html" in format: #No pandoc on travis
-                continue
-            self.doc.setformat(format)
-            self.doc.format()
-            self.out_file = self.out_base % format
-            self.ref_file = self.ref_base % format
-            self.doc.output = self.out_file
-            self.doc.write()
-            if "2html" in format:
-                pass
-                #Need to ignore same amount from beginning
-                #End is variable lenght, anyway tested with test_publish
-                #self.assertSameAsReference(1000) #Ignore changing footer
-            else:
-                self.assertSameAsReference()
-            try:
-                os.remove(self.out_file)
-            except FileNotFoundError:
-                pass
-
-    def contentOf(self, filename, end_ignore):
-        fh = open(filename)
-        content = fh.read()
-        fh.close()
-        if end_ignore > 0:
-            return(content[:-end_ignore])
-        return content
-
-    def assertSameAsReference(self, end_ignore = -1):
-        self.assertEqual(self.contentOf(self.out_file, end_ignore),
-               self.contentOf(self.ref_file, end_ignore))
-
-
-
-if __name__ == '__main__':
-    unittest.main()
diff --git a/tests/test_publish.py b/tests/test_publish.py
deleted file mode 100644
index 0c5e587..0000000
--- a/tests/test_publish.py
+++ /dev/null
@@ -1,23 +0,0 @@
-import pweave
-import os, io
-
-def test_publish():
-    """Test pypublish"""
-    pweave.publish("tests/publish/publish_test.txt", doc_format="html")
-    test = io.open("tests/publish/publish_test.html", "r").read().encode("utf-8")
-    ref = io.open("tests/publish/publish_test_ref.html", "r").read().encode("utf-8")
-    #Leave out the changing footer
-    assert (test[:len(test) - 400] == ref[:len(test) - 400])
-
-def test_publish_cell():
-    """Test pypublish cell format"""
-    pweave.publish("tests/publish/publish_test_cell.txt", doc_format="html")
-    test = io.open("tests/publish/publish_test_cell.html", "r").read().encode("utf-8")
-    ref = io.open("tests/publish/publish_test_ref.html", "r").read().encode("utf-8")
-    #Leave out the changing footer
-    assert (test[:len(test) - 400] == ref[:len(test) - 400])
-
-
-if __name__ == '__main__':
-    test_publish()
-    test_publish_cell()
diff --git a/tests/test_readers.py b/tests/test_readers.py
index 69a0303..69cd500 100644
--- a/tests/test_readers.py
+++ b/tests/test_readers.py
@@ -13,12 +13,6 @@ def test_script():
                       "tests/publish/publish_test_REF.py")
 
 
-def test_url():
-    pweave.weave("http://files.mpastell.com/formatters_test.pmd", doctype = "pandoc", output = "tests/formats/formatters_url.md")
-    assertSameContent("tests/formats/formatters_url.md", "tests/formats/formatters_test_REF.markdown")
-
-
-
 def assertSameContent(REF, outfile):
     out = open(outfile)
     ref = open(REF)
@@ -27,4 +21,3 @@ def assertSameContent(REF, outfile):
 if __name__ == '__main__':
     test_markdown()
     test_script()
-    test_url()