setup: fix a couple instances of hard-coded 'allmydata-tahoe' in the scripts, tighten the tests (as suggested by David-Sarah)

This commit is contained in:
Zooko O'Whielacronx 2010-08-01 09:42:07 -07:00
parent 44edecb36c
commit fd874d6669
3 changed files with 8 additions and 6 deletions

View File

@ -2,6 +2,7 @@
import os, sys import os, sys
from twisted.python import usage from twisted.python import usage
from allmydata.scripts.common import BasedirMixin, NoDefaultBasedirMixin from allmydata.scripts.common import BasedirMixin, NoDefaultBasedirMixin
import allmydata
class CreateClientOptions(BasedirMixin, usage.Options): class CreateClientOptions(BasedirMixin, usage.Options):
optParameters = [ optParameters = [
@ -29,7 +30,7 @@ client_tac = """
# -*- python -*- # -*- python -*-
import pkg_resources import pkg_resources
pkg_resources.require('allmydata-tahoe') pkg_resources.require('%s')
pkg_resources.require('twisted') pkg_resources.require('twisted')
from allmydata import client from allmydata import client
from twisted.application import service from twisted.application import service
@ -38,13 +39,13 @@ c = client.Client()
application = service.Application("allmydata_client") application = service.Application("allmydata_client")
c.setServiceParent(application) c.setServiceParent(application)
""" """ % (allmydata.__appname__,)
introducer_tac = """ introducer_tac = """
# -*- python -*- # -*- python -*-
import pkg_resources import pkg_resources
pkg_resources.require('allmydata-tahoe') pkg_resources.require('%s')
pkg_resources.require('twisted') pkg_resources.require('twisted')
from allmydata import introducer from allmydata import introducer
from twisted.application import service from twisted.application import service
@ -53,7 +54,7 @@ c = introducer.IntroducerNode()
application = service.Application("allmydata_introducer") application = service.Application("allmydata_introducer")
c.setServiceParent(application) c.setServiceParent(application)
""" """ % (allmydata.__appname__,)
def write_node_config(c, config): def write_node_config(c, config):
# this is shared between clients and introducers # this is shared between clients and introducers

View File

@ -6,7 +6,8 @@ import pkg_resources
pkg_resources.require('twisted') pkg_resources.require('twisted')
from twisted.python import usage from twisted.python import usage
pkg_resources.require('allmydata-tahoe') import allmydata
pkg_resources.require(allmydata.__appname__)
from allmydata.scripts.common import BaseOptions from allmydata.scripts.common import BaseOptions
from allmydata.scripts import debug, create_node, startstop_node, cli, keygen, stats_gatherer from allmydata.scripts import debug, create_node, startstop_node, cli, keygen, stats_gatherer

View File

@ -59,7 +59,7 @@ class BinTahoe(common_util.SignalMixin, unittest.TestCase, SkipMixin):
def _cb(res): def _cb(res):
out, err, rc_or_sig = res out, err, rc_or_sig = res
self.failUnlessEqual(rc_or_sig, 0, res) self.failUnlessEqual(rc_or_sig, 0, res)
self.failUnless(out.startswith(allmydata.__appname__), res) self.failUnless(out.startswith(allmydata.__appname__+':'), res)
self.failIfIn("DeprecationWarning", out, res) self.failIfIn("DeprecationWarning", out, res)
self.failUnlessEqual(err, "", res) self.failUnlessEqual(err, "", res)
d.addCallback(_cb) d.addCallback(_cb)