• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

PulpQE / pulp-smash / 37 / 1
63%
master: 63%

Build:
DEFAULT BRANCH: master
Ran 16 Oct 2015 09:16PM UTC
Files 1
Run time 0s
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

16 Oct 2015 09:10PM UTC coverage: 89.011%. First build
37.1

push

travis-ci

Ichimonji10
Overhaul the ServerConfig class

Leave the `ServerConfig` class and its helper, `get_config`, in module
`pulp_smash.config`. However, significantly change them. Change `ServerConfig`
from a dict-like object with several mixins to a plain old object. According to
its docstring:

    This object stores a set of facts that are used when communicating with a
    Pulp server. A typical usage of this object is as follows:

    >>> import requests
    >>> from pulp_smash.config import ServerConfig
    >>> cfg = ServerConfig(
    ...     base_url='https://pulp.example.com',
    ...     auth=('username', 'password'),
    ...     verify=False,  # Disable SSL verification
    ... )
    >>> response = requests.post(
    ...     cfg.base_url + '/pulp/api/v2/actions/login/',
    ...     **cfg.get_requests_kwargs()
    ... )

Fix #12 by only giving the object instance attributes. Fix #16 by making the
class inherit directly from `object`. As a bonus, the class is now entirely
self-contained and reasonably sized, which should aid with comprehension. This
change also targets #13, as each of the file-oriented methods has the ability to
select a particular XDG configuration directory or file if appropriate. For
example, here is `read`'s signature:

    def read(self, section=None, xdg_config_file=None, xdg_config_dir=None):

Update the existing test code to use the new object. Test results:

    $ python -m unittest2 discover pulp_smash.tests
    ....F...
    …
    ----------------------------------------------------------------------
    Ran 8 tests in 4.006s

    FAILED (failures=1)

The one test failure is expected.

Unit test the new class.

81 of 91 relevant lines covered (89.01%)

0.89 hits per line

Source Files on job 37.1
  • Tree
  • List 0
  • Changed 0
  • Source Changed 0
  • Coverage Changed 0
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Build 37
  • Travis Job 37.1
  • 8f7dea36 on github
  • Next Job for on master (#39.4)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc