Ejemplo n.º 1
0
    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)
Ejemplo n.º 2
0
 def test_to_string(self) -> None:
     with self.assertRaises(NotImplementedError):
         fl.Importer().from_string("")
Ejemplo n.º 3
0
 def test_class_name(self) -> None:
     self.assertEqual(fl.Importer().class_name, "Importer")