def test_disabled_component_is_not_written_to_script(self):
        psyexp_file = os.path.join(TESTS_DATA_PATH,
                                   'TextComponent_disabled.psyexp')
        outfile = 'outfile.py'
        psyexpCompile.compileScript(infile=psyexp_file, outfile=outfile)

        with io.open(outfile, mode='r', encoding='utf-8-sig') as f:
            script = f.read()
            assert 'visual.TextStim' not in script
Exemple #2
0
 def compileScript(self, infile=None, version=None, outfile=None):
     """
     Compile script used to test whether JS modular files are written
     :param infile: psyexp file
     :param version: Version to use
     :param outfile: For testing JS filename
     :return: True
     """
     psyexpCompile.compileScript(infile, version, outfile)
     return True
 def create_component_output(self, compName):
     """Create the JS script"""
     jsFilePath = os.path.join(os.getcwd(), 'new{}.js'.format(compName))
     psyexpCompile.compileScript(infile=self.exp, outfile=jsFilePath)
 def create_component_output(self, compName):
     """Create the Python script"""
     psyexpCompile.compileScript(infile=self.exp, outfile='new{}.py'.format(compName))
 def create_component_output(self, compName):
     """Create the JS script"""
     jsFilePath = os.path.join(os.getcwd(), 'new{}.js'.format(compName))
     psyexpCompile.compileScript(infile=self.exp, outfile=jsFilePath)
Exemple #6
0
 def create_component_output(self, compName):
     """Create the Python script"""
     psyexpCompile.compileScript(infile=self.exp,
                                 outfile='new{}.py'.format(compName))
 def create_component_output(self, compName):
     """Create the Python script"""
     pyFilePath = os.path.join(self.temp_dir, 'new{}.py'.format(compName))
     psyexpCompile.compileScript(infile=self.exp, outfile=pyFilePath)