def test_from_file(self) -> None: importer = fl.Importer() importer.from_string = MagicMock( # type: ignore side_effect=lambda string: fl.Engine(description=string)) path = tempfile.mkstemp(text=True)[1] with io.open(path, 'w') as file: file.write(BELL_FLL) engine = importer.from_file(path) self.assertEqual(BELL_FLL, engine.description) os.remove(path)
def test_to_string(self) -> None: with self.assertRaises(NotImplementedError): fl.Importer().from_string("")
def test_class_name(self) -> None: self.assertEqual(fl.Importer().class_name, "Importer")