def test_01_01_equality(self): x=cps.Setting("text","value") self.assertTrue(x == "value") self.assertTrue(x != "text") self.assertFalse(x != "value") self.assertFalse(x == "text") self.assertEqual(x.value,"value")
def create_settings(self): '''Create the module settings and name the module''' self.wants_default_output_directory = cps.Binary( "Store batch files in default output folder?", True, doc=""" Check this box to store batch files in the Default Output folder. Uncheck the box to enter the path to the folder that will be used to store these files.""") self.custom_output_directory = cps.Text( "Output folder path", cpprefs.get_default_output_directory(), doc=""" Enter the path to the output folder.""") # Worded this way not because I am windows-centric but because it's # easier than listing every other OS in the universe except for VMS self.remote_host_is_windows = cps.Binary( "Are the cluster computers running Windows?", False, doc=""" Check this box if the cluster computers are running one of the Microsoft Windows operating systems. If you check this box, <b>CreateBatchFiles</b> will modify all paths to use the Windows file separator (backslash \). If you leave the box unchecked, <b>CreateBatchFiles</b> will modify all paths to use the Unix or Macintosh file separator (slash /).""") self.batch_mode = cps.Binary("Hidden: in batch mode", False) self.distributed_mode = cps.Binary("Hidden: in distributed mode", False) self.default_image_directory = cps.Setting( "Hidden: default input folder at time of save", cpprefs.get_default_image_directory()) self.revision = cps.Integer("Hidden: revision number", 0) self.from_old_matlab = cps.Binary("Hidden: from old matlab", False) self.acknowledge_old_matlab = cps.DoSomething( "Could not update CP1.0 pipeline to be compatible with CP2.0. See module notes.", "OK", self.clear_old_matlab) self.mappings = [] self.add_mapping() self.add_mapping_button = cps.DoSomething("", "Add another path mapping", self.add_mapping, doc=""" Use this option if another path must be mapped because there is a difference between how the local computer sees a folder location vs. how the cluster computer sees the folder location.""") self.check_path_button = cps.DoSomething( "Press this button to check pathnames on the remote server", "Check paths", self.check_paths, doc=""" his button will start a routine that will ask the webserver to check whether the default input and default output folders exist. It will also check whether all remote path mappings exist.""")
def test_00_00_init(self): x=cps.Setting("text","value") x.test_valid(None) self.assertEqual(x.text,"text") self.assertEqual(x.value,"value") self.assertTrue(x.key())