Ejemplo n.º 1
0
    def test_save_exporter(self):
        import macropy

        macropy.exporter = SaveExporter(__file__ + "/../exported", __file__ + "/..")

        # the original code should work
        import save
        assert save.run() == 14

        macropy.exporter = NullExporter()

        # the copy of the code saved in the ./exported folder should work too
        import macropy.core.test.exporters.exported.save as save_exported
        assert save_exported.run() == 14
        import shutil
        shutil.rmtree(__file__ + "/../exported")
Ejemplo n.º 2
0
    def test_save_exporter(self):
        import macropy

        exported_folder = os.path.join(THIS_FOLDER, "exported")
        macropy.exporter = SaveExporter(exported_folder, THIS_FOLDER)

        # the original code should work
        import save
        assert save.run() == 14

        macropy.exporter = NullExporter()

        # the copy of the code saved in the ./exported folder should work too
        import macropy.core.test.exporters.exported.save as save_exported
        assert save_exported.run() == 14
        import shutil
        shutil.rmtree(exported_folder)
Ejemplo n.º 3
0
    def test_save_exporter(self):
        import macropy

        exported = os.path.join(THIS_FOLDER, "exported")
        macropy.exporter = SaveExporter(exported, THIS_FOLDER)

        # the original code should work
        import save
        assert save.run() == 14

        macropy.exporter = NullExporter()

        # the copy of the code saved in the ./exported folder should work too
        import macropy.core.test.exporters.exported.save as save_exported
        assert save_exported.run() == 14
        import shutil
        shutil.rmtree(exported)
Ejemplo n.º 4
0
    def test_save_exporter(self):
        import macropy

        macropy.exporter = SaveExporter(__file__ + "/../exported",
                                        __file__ + "/..")

        # the original code should work
        import save
        assert save.run() == 14

        macropy.exporter = NullExporter()

        # the copy of the code saved in the ./exported folder should work too
        import macropy.core.test.exporters.exported.save as save_exported
        assert save_exported.run() == 14
        import shutil
        shutil.rmtree(__file__ + "/../exported")