예제 #1
0
def test_strip_slash():
    """Verifies that the same base_url is generated if
    a trailing slash is added or not.
    """
    api1 = python_wpapi.WpApi('http://base.url')
    api2 = python_wpapi.WpApi('http://base.url/')
    assert api1.base_url == api2.base_url
예제 #2
0
def test_auth():
    """Check the possible self.auth combinations.
    """
    api1 = python_wpapi.WpApi('http://base.url')
    api2 = python_wpapi.WpApi('http://base.url', user='******')
    api3 = python_wpapi.WpApi('http://base.url',
                              user='******',
                              password='******')
    assert api1.auth == None
    assert api2.auth == ('User', None)
    assert api3.auth == ('User', 'Password')
예제 #3
0
def api():
    """Sample pytest fixture.
    See more at: http://doc.pytest.org/en/latest/fixture.html
    """
    # import requests
    # return requests.get('https://github.com/audreyr/cookiecutter-pypackage')
    return python_wpapi.WpApi('http://base.url')