def test_to_file(self) -> None: exporter = fl.Exporter() exporter.to_string = MagicMock(return_value="MagicMock Test") # type: ignore path = tempfile.mkstemp(text=True)[1] exporter.to_file(path, object()) with io.open(path, "r") as exported: self.assertEqual("MagicMock Test", exported.read()) os.remove(path)
def test_to_string(self) -> None: with self.assertRaises(NotImplementedError): fl.Exporter().to_string(None)
def test_class_name(self) -> None: self.assertEqual(fl.Exporter().class_name, "Exporter")