| skipped 110 lines |
111 | 111 | | expected_filename = "julian.txt" |
112 | 112 | | string_to_test = "Julian30771" |
113 | 113 | | |
| 114 | + | # delete the file if it already exists |
| 115 | + | if os.path.isfile(expected_filename): |
| 116 | + | os.remove(expected_filename) |
| 117 | + | |
114 | 118 | | user_input = [ |
115 | 119 | | "Julian", # First Name |
116 | 120 | | "Assange", # Surname |
| skipped 15 lines |
132 | 136 | | |
133 | 137 | | test_ok = False |
134 | 138 | | |
| 139 | + | with patch("builtins.input", side_effect=user_input): |
| 140 | + | stacks = interactive() |
| 141 | + | |
135 | 142 | | if os.path.isfile(expected_filename): |
136 | 143 | | if string_to_test in open(expected_filename).read(): |
137 | 144 | | test_ok = True |
138 | | - | |
139 | | - | with patch("builtins.input", side_effect=user_input): |
140 | | - | stacks = interactive() |
141 | 145 | | |
142 | 146 | | self.assertTrue(test_ok, "interactive generation works") |
143 | 147 | | |
| skipped 4 lines |