MCPcopy Create free account
hub / github.com/ipython/traitlets / test_expanduser

Method test_expanduser

tests/config/test_loader.py:294–302  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

292 self.assertEqual(Unicode().from_string(config.D.C.value), "hi there")
293
294 def test_expanduser(self):
295 cl = self.klass(log=log)
296 argv = ["--a=~/1/2/3", "--b=~", "--c=~/", '--d="~/"']
297 config = cl.load_config(argv)
298 u = Unicode()
299 self.assertEqual(u.from_string(config.a), os.path.expanduser("~/1/2/3"))
300 self.assertEqual(u.from_string(config.b), os.path.expanduser("~"))
301 self.assertEqual(u.from_string(config.c), os.path.expanduser("~/"))
302 self.assertEqual(u.from_string(config.d), "~/")
303
304 def test_extra_args(self):
305 cl = self.klass(log=log)

Callers

nothing calls this directly

Calls 3

from_stringMethod · 0.95
UnicodeClass · 0.90
load_configMethod · 0.45

Tested by

no test coverage detected