コード例 #1
0
 def test_bad_data(self):
     # If incorrect data is retrieved, the main function will return 1
     # (which will be used as the processes exit code to signal an error).
     with fake_urllib(BadUrllib()):
         self.assertEquals(
             do_smoketest(self.fake_librarian,
                          self.fake_librarian,
                          output=StringIO()), 1)
コード例 #2
0
 def test_bad_data(self):
     # If incorrect data is retrieved, the main function will return 1
     # (which will be used as the processes exit code to signal an error).
     with fake_urllib(BadUrllib()):
         self.assertEquals(
             do_smoketest(self.fake_librarian, self.fake_librarian,
                          output=StringIO()),
             1)
コード例 #3
0
 def test_exception(self):
     # If an exception is raised when retrieving the data, the main
     # function will return 1 (which will be used as the processes exit
     # code to signal an error).
     with fake_urllib(ErrorUrllib()):
         self.assertEquals(
             do_smoketest(self.fake_librarian,
                          self.fake_librarian,
                          output=StringIO()), 1)
コード例 #4
0
 def test_good_data(self):
     # If storing and retrieving both the public and private files work,
     # the main function will return 0 (which will be used as the processes
     # exit code to signal success).
     with fake_urllib(GoodUrllib()):
         self.assertEquals(
             do_smoketest(self.fake_librarian,
                          self.fake_librarian,
                          output=StringIO()), 0)
コード例 #5
0
 def test_exception(self):
     # If an exception is raised when retrieving the data, the main
     # function will return 1 (which will be used as the processes exit
     # code to signal an error).
     with fake_urllib(ErrorUrllib()):
         self.assertEquals(
             do_smoketest(self.fake_librarian, self.fake_librarian,
                          output=StringIO()),
             1)
コード例 #6
0
 def test_good_data(self):
     # If storing and retrieving both the public and private files work,
     # the main function will return 0 (which will be used as the processes
     # exit code to signal success).
     with fake_urllib(GoodUrllib()):
         self.assertEquals(
             do_smoketest(self.fake_librarian, self.fake_librarian,
                          output=StringIO()),
             0)
コード例 #7
0
#! /usr/bin/python -S
#
# Copyright 2010 Canonical Ltd.  This software is licensed under the
# GNU Affero General Public License version 3 (see the file LICENSE).

"""Perform simple librarian operations to verify the current configuration.
"""

import _pythonpath

import sys

from zope.component import getUtility

from lp.services.librarian.interfaces.client import (
    ILibrarianClient,
    IRestrictedLibrarianClient,
    )
from lp.services.librarian.smoketest import do_smoketest
from lp.services.scripts import execute_zcml_for_scripts


if __name__ == '__main__':
    execute_zcml_for_scripts()
    restricted_client = getUtility(IRestrictedLibrarianClient)
    regular_client = getUtility(ILibrarianClient)
    sys.exit(do_smoketest(restricted_client, regular_client))
コード例 #8
0
#! /usr/bin/python -S
#
# Copyright 2010 Canonical Ltd.  This software is licensed under the
# GNU Affero General Public License version 3 (see the file LICENSE).
"""Perform simple librarian operations to verify the current configuration.
"""

import _pythonpath

import sys

from zope.component import getUtility

from lp.services.librarian.interfaces.client import (
    ILibrarianClient,
    IRestrictedLibrarianClient,
)
from lp.services.librarian.smoketest import do_smoketest
from lp.services.scripts import execute_zcml_for_scripts

if __name__ == '__main__':
    execute_zcml_for_scripts()
    restricted_client = getUtility(IRestrictedLibrarianClient)
    regular_client = getUtility(ILibrarianClient)
    sys.exit(do_smoketest(restricted_client, regular_client))