##// END OF EJS Templates
Added simple tests for IPython.config.loader.
Brian Granger -
Show More
@@ -110,13 +110,16 b' class PyFileConfigLoader(FileConfigLoader):'
110
110
111 def _find_file(self):
111 def _find_file(self):
112 """Try to find the file by searching the paths."""
112 """Try to find the file by searching the paths."""
113 if os.path.isfile(os.path.expanduser(self.filename)):
114 self.full_filename = os.path.expanduser(self.filename)
115 return
113 if self.path == '.':
116 if self.path == '.':
114 self.path = [os.getcwd()]
117 self.path = [os.getcwd()]
115 if not isinstance(path, (list, tuple)):
118 if not isinstance(path, (list, tuple)):
116 raise TypeError("path must be a list or tuple, got: %r" % self.path)
119 raise TypeError("path must be a list or tuple, got: %r" % self.path)
117 for p in self.path:
120 for p in self.path:
118 if p == '.': p = os.getcwd()
121 if p == '.': p = os.getcwd()
119 full_filename = os.path.join(p, self.filename)
122 full_filename = os.path.expanduser(os.path.join(p, self.filename))
120 if os.path.isfile(full_filename):
123 if os.path.isfile(full_filename):
121 self.full_filename = full_filename
124 self.full_filename = full_filename
122 return
125 return
@@ -175,8 +178,8 b' class ArgParseConfigLoader(CommandLineConfigLoader):'
175
178
176 def _add_arguments(self):
179 def _add_arguments(self):
177 for argument in self.arguments:
180 for argument in self.arguments:
178 argument[1]['default'] = NoDefault
181 if not argument[1].has_key('default'):
179 print argument
182 argument[1]['default'] = NoDefault
180 self.parser.add_argument(*argument[0],**argument[1])
183 self.parser.add_argument(*argument[0],**argument[1])
181
184
182 def _parse_args(self, args=None):
185 def _parse_args(self, args=None):
General Comments 0
You need to be logged in to leave comments. Login now