def __init__(self):
     self.appargs = ApplicationArguments()
     logger.set_debug(self.appargs.degbug())
     self.manuscript = Manuscript(self.appargs.manuscripts(),
                                  self.appargs.paths(),
                                  self.appargs.placeholders())
     if self.appargs.autoexit():
         self.manuscript.add_autoexit_instruction()
Beispiel #2
0
 def test_manuscript_found_in_given_directory_returns_instruction_list(self):
     PATH = r"c:\temp\test_dialog1.txt"
     self.given_file_with_instructions(PATH, ["click OK"])
     manuscripts = ["test_dialog1.txt"]
     paths = [r"c:\temp"]
     manuscript = Manuscript(manuscripts, paths)
     instructions = manuscript.get_instructions()
     self.assertEquals(["# Loading data 'test_dialog1.txt'", "click OK"], instructions)
     os.remove(PATH)
Beispiel #3
0
 def test_manuscript_found_in_current_directory_returns_instruction_list(self):
     FILE = "test_dialog1.txt"
     PATH = FILE
     self.given_file_with_instructions(PATH, ["click OK"])
     manuscripts = [FILE]
     paths = []
     manuscript = Manuscript(manuscripts, paths)
     instructions = manuscript.get_instructions()
     self.assertEquals(["# Loading data 'test_dialog1.txt'", "click OK"], instructions)
     os.remove(PATH)
Beispiel #4
0
 def test_manuscript_found_in_autopilot_home_directory_returns_instruction_list(self):
     FILE = "test_dialog1.txt"
     DIR = r"c:\temp"
     PATH = r"%s\%s" % (DIR, FILE)
     self.given_file_with_instructions(PATH, ["click OK"])
     manuscripts = [FILE]
     paths = []
     os.environ["AUTOPILOT_HOME"] = DIR
     manuscript = Manuscript(manuscripts, paths)
     self.assertEquals(["# Loading data 'test_dialog1.txt'", "click OK"], manuscript.get_instructions())
     os.remove(PATH)
Beispiel #5
0
 def test_manuscripts_are_concatenated(self):
     FILE1 = "test_dialog1.txt"
     FILE2 = "test_dialog2.txt"
     DIR = r"c:\temp"
     PATH1 = r"%s\%s" % (DIR, FILE1)
     PATH2 = r"%s\%s" % (DIR, FILE2)
     self.given_file_with_instructions(PATH1, ["click OK"])
     self.given_file_with_instructions(PATH2, ["click Cancel"])
     manuscripts = [FILE1, FILE2]
     os.environ["AUTOPILOT_HOME"] = DIR
     manuscript = Manuscript(manuscripts, [])
     self.assertEquals([
         "# Loading data 'test_dialog1.txt'",
         "click OK",
         "# Loading data 'test_dialog2.txt'",
         "click Cancel",
     ], manuscript.get_instructions())
     os.remove(PATH1)
     os.remove(PATH2)
Beispiel #6
0
 def test_no_manuscript_found_returns_commented_instruction_list(self):
     manuscripts = ["test_dialog1.txt"]
     paths = []
     manuscript = Manuscript(manuscripts, paths)
     instructions = manuscript.get_instructions()
     self.assertEquals(["# Loading data 'test_dialog1.txt'", "# Path not found for data file 'test_dialog1.txt'"], instructions)
Beispiel #7
0
 def test_no_input_returns_empty_instruction_list(self):
     manuscripts = []
     paths = []
     manuscript = Manuscript(manuscripts, paths)
     instructions = manuscript.get_instructions()
     self.assertEquals([], instructions)