Exemple #1
0
 def test_outputFileSelection(self):
     """
     The --output option selects the file to write to, '-' or no parameter
     meaning stdout; the L{ExportOptions.openOutput} method returns that
     file.
     """
     eo = ExportOptions()
     eo.parseOptions([])
     self.assertIdentical(eo.openOutput(), sys.stdout)
     eo = ExportOptions()
     eo.parseOptions(["--output", "-"])
     self.assertIdentical(eo.openOutput(), sys.stdout)
     eo = ExportOptions()
     tmpnam = self.mktemp()
     eo.parseOptions(["--output", tmpnam])
     self.assertEquals(eo.openOutput().name, tmpnam)
 def test_outputFileSelection(self):
     """
     The --output option selects the file to write to, '-' or no parameter
     meaning stdout; the L{ExportOptions.openOutput} method returns that
     file.
     """
     eo = ExportOptions()
     eo.parseOptions([])
     self.assertIdentical(eo.openOutput(), sys.stdout)
     eo = ExportOptions()
     eo.parseOptions(["--output", "-"])
     self.assertIdentical(eo.openOutput(), sys.stdout)
     eo = ExportOptions()
     tmpnam = self.mktemp()
     eo.parseOptions(["--output", tmpnam])
     self.assertEquals(eo.openOutput().name, tmpnam)