def test_defaults(resource='machines'):
    client = ResourceManagerClient(resource)
    assert client.resource_type == resource
    defaults = dict(endpoint='http://127.0.0.1:5000/machines', resource_type='machines', key='hostname',
                    auth=('admin', 'admin'), headers={'content-type': 'application/json'},
                    fields=["hostname", "owner", "state", "job_id", "tags", "_updated", "_id"])
    for attribute, value in defaults.iteritems():
        try:
            assert value == client.__getattribute__(attribute)
        except AssertionError:
            raise AssertionError("Default for {0} should be:{1}\n"
                                 "Received: {2}".format(attribute, client.__getattribute__(attribute), value))
Beispiel #2
0
def test_defaults(resource='machines'):
    client = ResourceManagerClient(resource)
    assert client.resource_type == resource
    defaults = dict(
        endpoint='http://127.0.0.1:5000/machines',
        resource_type='machines',
        key='hostname',
        auth=('admin', 'admin'),
        headers={'content-type': 'application/json'},
        fields=["hostname", "owner", "state", "job_id", "_updated", "_id"])
    for attribute, value in defaults.iteritems():
        try:
            assert value == client.__getattribute__(attribute)
        except AssertionError:
            raise AssertionError("Default for {0} should be:{1}\n"
                                 "Received: {2}".format(
                                     attribute,
                                     client.__getattribute__(attribute),
                                     value))