Esempio n. 1
0
    def test_write_file(self):
        Controller.process = lambda _: 0

        with fake_project():
            self.config.parseOptions(['controller', 'test_controller'])
            controller = Controller(self.config)
            controller._write_controller()
            controller_file = filepath.FilePath(
                'application/controller/test_controller.py')

            self.assertTrue(controller_file.exists())
            controller_file.remove()
Esempio n. 2
0
    def test_write_file(self):
        Controller.process = lambda _: 0

        with fake_project():
            self.config.parseOptions(['controller', 'test_controller'])
            controller = Controller(self.config)
            controller._write_controller()
            controller_file = filepath.FilePath(
                'application/controller/test_controller.py'
            )

            self.assertTrue(controller_file.exists())
            controller_file.remove()
Esempio n. 3
0
    def test_write_file(self):
        Controller.process = lambda _: 0

        currdir = os.getcwd()
        os.chdir('../mamba/test/dummy_app/')

        self.config.parseOptions(['controller', 'test_controller'])
        controller = Controller(self.config)
        controller._write_controller()
        controller_file = filepath.FilePath(
            'application/controller/test_controller.py')

        self.assertTrue(controller_file.exists())
        controller_file.remove()

        os.chdir(currdir)
Esempio n. 4
0
    def test_write_file(self):
        Controller.process = lambda _: 0

        currdir = os.getcwd()
        os.chdir('../mamba/test/dummy_app/')

        self.config.parseOptions(['controller', 'test_controller'])
        controller = Controller(self.config)
        controller._write_controller()
        controller_file = filepath.FilePath(
            'application/controller/test_controller.py'
        )

        self.assertTrue(controller_file.exists())
        controller_file.remove()

        os.chdir(currdir)