Beispiel #1
0
    def testProcess(self):

        filepath = "filepath"
        
        opener = MockOpener()
        file_handler = sphinxtogithub.FileHandler(filepath, [], opener)

        file_handler.process()

        self.assertEqual(opener.file_object.written, MockFileObject.before)
        self.assertEqual(opener.name, filepath)
Beispiel #2
0
    def testProcessWithReplacers(self):

        filepath = "filepath"
        
        replacers = []
        replacers.append(sphinxtogithub.Replacer("_static/default.css", "static/default.css"))
        replacers.append(sphinxtogithub.Replacer("_static/pygments.css", "static/pygments.css"))

        opener = MockOpener()
        file_handler = sphinxtogithub.FileHandler(filepath, replacers, opener)

        file_handler.process()

        self.assertEqual(opener.file_object.written, MockFileObject.after)
Beispiel #3
0
    def create_file_handler(self, name, replacers, opener):

        return sphinxtogithub.FileHandler(name, replacers, opener)