Changeset 9d87f8d in trunk


Ignore:
Timestamp:
2012-04-05T23:57:23Z (13 years ago)
Author:
david-sarah <david-sarah@…>
Branches:
master
Children:
496b65bf
Parents:
4e93f77
Message:

Change capitalization of WUI and introducer welcome page headings; add test for introducer welcome page. Also fix a typo in a CSS class name. fixes #1708

Location:
src/allmydata
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified src/allmydata/test/test_web.py

    r4e93f77 r9d87f8d  
    22import simplejson
    33from StringIO import StringIO
     4
    45from twisted.application import service
    56from twisted.trial import unittest
     
    89from twisted.web import client, error, http
    910from twisted.python import failure, log
     11
     12from foolscap.api import fireEventually, flushEventualQueue
     13
    1014from nevow import rend
     15
    1116from allmydata import interfaces, uri, webish, dirnode
    1217from allmydata.storage.shares import get_share_file
     
    3338     HTTPClientHEADFactory
    3439from allmydata.client import Client, SecretHolder
     40from allmydata.introducer import IntroducerNode
    3541
    3642# create a fake uploader/downloader, and a couple of fake dirnodes, then
     
    503509        d = self.GET("/")
    504510        def _check(res):
    505             self.failUnlessIn('Welcome To Tahoe-LAFS', res)
     511            self.failUnlessIn('Welcome to Tahoe-LAFS', res)
    506512            self.failUnlessIn(FAVICON_MARKUP, res)
    507513            self.failUnlessIn('href="https://tahoe-lafs.org/"', res)
     
    38153821
    38163822
     3823class IntroducerWeb(unittest.TestCase):
     3824    def setUp(self):
     3825        self.node = None
     3826
     3827    def tearDown(self):
     3828        d = defer.succeed(None)
     3829        if self.node:
     3830            d.addCallback(lambda ign: self.node.stopService())
     3831        d.addCallback(flushEventualQueue)
     3832        return d
     3833
     3834    def test_welcome(self):
     3835        basedir = "web.IntroducerWeb.test_welcome"
     3836        os.mkdir(basedir)
     3837        fileutil.write(os.path.join(basedir, "tahoe.cfg"), "[node]\nweb.port = tcp:0\n")
     3838        self.node = IntroducerNode(basedir)
     3839        self.ws = self.node.getServiceNamed("webish")
     3840
     3841        d = fireEventually(None)
     3842        d.addCallback(lambda ign: self.node.startService())
     3843        d.addCallback(lambda ign: self.node.when_tub_ready())
     3844
     3845        d.addCallback(lambda ign: self.GET("/"))
     3846        def _check(res):
     3847            self.failUnlessIn('Welcome to the Tahoe-LAFS Introducer', res)
     3848            self.failUnlessIn(FAVICON_MARKUP, res)
     3849        d.addCallback(_check)
     3850        return d
     3851
     3852    def GET(self, urlpath, followRedirect=False, return_response=False,
     3853            **kwargs):
     3854        # if return_response=True, this fires with (data, statuscode,
     3855        # respheaders) instead of just data.
     3856        assert not isinstance(urlpath, unicode)
     3857        url = self.ws.getURL().rstrip('/') + urlpath
     3858        factory = HTTPClientGETFactory(url, method="GET",
     3859                                       followRedirect=followRedirect, **kwargs)
     3860        reactor.connectTCP("localhost", self.ws.getPortnum(), factory)
     3861        d = factory.deferred
     3862        def _got_data(data):
     3863            return (data, factory.status, factory.response_headers)
     3864        if return_response:
     3865            d.addCallback(_got_data)
     3866        return factory.deferred
     3867
     3868
    38173869class Util(ShouldFailMixin, testutil.ReallyEqualMixin, unittest.TestCase):
    38183870    def test_load_file(self):
  • TabularUnified src/allmydata/web/introducer.xhtml

    r4e93f77 r9d87f8d  
    66</head><body>
    77
    8 <h1>Welcome To The Tahoe-LAFS Introducer</h1>
     8<h1>Welcome to the Tahoe-LAFS Introducer</h1>
    99
    1010<div class="section" id="this-client">
     
    1212
    1313  <table class="node-info table-headings-left">
    14     <tr><th>My nodeid:</th> <td class="nideid mine data-chars" n:render="string" n:data="my_nodeid" /></tr>
     14    <tr><th>My nodeid:</th> <td class="nodeid mine data-chars" n:render="string" n:data="my_nodeid" /></tr>
    1515    <tr><th>My versions:</th> <td n:render="string" n:data="version" /></tr>
    1616    <tr><th>Tahoe-LAFS code imported from:</th> <td n:render="string" n:data="import_path" /></tr>
  • TabularUnified src/allmydata/web/welcome.xhtml

    r4e93f77 r9d87f8d  
    66</head><body>
    77
    8 <h1>Welcome To Tahoe-LAFS!</h1>
     8<h1>Welcome to Tahoe-LAFS!</h1>
    99
    1010<div class="section" id="this-client">
Note: See TracChangeset for help on using the changeset viewer.