Example #1
0
	def get_note(self):
		note = self._config.get("NOTE")
		if note:
			return note
		elif not self._config.flags.get("NONOTE"):
			import cliutils
			return cliutils.get_text("> ", "Enter a small note to describe the test conditions. End with single '.'.")
		else:
			return None
Example #2
0
 def script(self, argv):
     """script [-f <filename>] [<text>]
 Run a script on the server."""
     fname = None
     opts, longopts, args = self.getopt(argv, "f:")
     for opt, arg in opts:
         if opt == "-f":
             fname = arg
     if fname:
         text = file(fname).read()
         return self._runscript(text)
     else:
         text = " ".join(args)
         if text:
             return self._runscript(text)
         else:
             import cliutils
             text = cliutils.get_text("script> ")
             if text:
                 return self._runscript(text)
             else:
                 self._print(self.script.__doc__)
                 return
Example #3
0
	def get_text(self, msg=None):
		if self.INTERACTIVE:
			return cliutils.get_text("> ", msg)
		else:
			raise TestIncompleteError, "user input in non-interactive test."