Пример #1
0
    def test_list_paths__None(self):
        prog = "testapp"
        home = os.environ.get("HOME", os.curdir)

        paths = ["/etc/%s.conf" % prog]
        paths += sorted(glob.glob("/etc/%s.d/*.conf" % prog))
        paths += [os.path.join(home, ".config", prog)]
        paths += [
            os.environ.get(
                "%sRC" % prog.upper(),
                os.path.join(home, ".%src" % prog)
            )
        ]

        paths_r = A.list_paths(prog, None)

        for p in paths:
            self.assertTrue(p in paths_r,
                            "Expected %s in %s" % (p, str(paths_r)))
Пример #2
0
 def test_list_paths__not_None(self):
     self.assertEquals(["/a/b/c"], A.list_paths("testapp", ["/a/b/c"]))