def test_print_baseurl(self):
        basedir = os.path.join(self.make_basedir(), "node1")
        not_basedir = basedir+"-NOT"
        d = self.cliMustSucceed("create-node", basedir)
        def _check(out):
            self.failUnless(out.startswith("node created in %s, URL is http://localhost:" % basedir), out)
        d.addCallback(_check)
        d.addCallback(lambda _: self.cliMustSucceed("print-baseurl", basedir))
        def _check_baseurl(out):
            self.failUnless(out.startswith("http://localhost:"), out)
        d.addCallback(_check_baseurl)
        d.addCallback(lambda _: self.cli("print-baseurl", not_basedir))
        def _check_not_baseurl((out, err, rc)):
            self.failUnlessEqual(rc, 1)
            self.failUnlessEqual(err.strip(), "'%s' doesn't look like a Petmail basedir, quitting" % not_basedir)
        d.addCallback(_check_not_baseurl)
        return d
dataset/ETHPy150Open warner/petmail/petmail/test/test_node.py/CLI.test_print_baseurl/original