def gets_provyfile_path_from_args(self): existing_file = 'path/to/provyfile.py' with patch.object(os.path, 'exists') as exists: exists.return_value = True self.assertEqual(provyfile_path_from(args=[existing_file]), existing_file)
def main(): sys.path.insert(0, os.curdir) extra_options = __get_extra_options() (options, args) = __get_arguments() provyfile_path = provyfile_path_from(args) if options.server is None and provyfile_path: # TODO: Improve this code to 'find' the set of servers defined in the # provyfile and run with the defined server set (if only one is defined) print "\nInfo: Provy is running using the 'test' set of servers.\n" options.server = 'test' run(provyfile_path, options.server, options.password, extra_options)
def gets_provy_file_as_default_value_if_existant(self): with patch.object(os.path, 'exists') as exists: exists.side_effect = [False, True] self.assertEqual(provyfile_path_from(args=[]), 'provy_file.py')