Ejemplo n.º 1
0
def test_hit_the_first_page(context):
    "It should be possible hit the first page empty"

    # Given that I have the test client
    manager = CurdManager(FIXTURE('project1', '.curds'))
    client = Server(manager, __name__).test_client()

    # When I hit the main page of the api
    result = client.get('/')

    # Then I see it returned nothing, since we have no curds yet
    result.status_code.should.equal(200)
    loads(result.data).should.equal([])
Ejemplo n.º 2
0
def test_hit_the_first_page(context):
    "It should be possible hit the first page empty"

    # Given that I have the test client
    manager = CurdManager(FIXTURE('project1', '.curds'))
    client = Server(manager, __name__).test_client()

    # When I hit the main page of the api
    result = client.get('/')

    # Then I see it returned nothing, since we have no curds yet
    result.status_code.should.equal(200)
    loads(result.data).should.equal([])
Ejemplo n.º 3
0
def test_list_available_curds(context):
    "It should be possible to list available curds"

    manager = CurdManager(FIXTURE('project1', '.curds'),
                          {'index-url': 'http://localhost:8000/simple'})
    uid = manager.add([FIXTURE('project1', 'requirements.txt')])

    # Given that I have a manager with a curd and an http client
    client = Server(manager, __name__).test_client()
    curd = manager.new(uid)

    # When I try to list all the available curds
    result = client.get('/')

    # Then I see that the newly created curd is available in the response list
    loads(result.data).should.equal([{
        'uid': uid,
        'url': '/{}'.format(uid),
    }])
Ejemplo n.º 4
0
def test_list_available_curds(context):
    "It should be possible to list available curds"

    manager = CurdManager(
        FIXTURE('project1', '.curds'),
        {'index-url': 'http://localhost:8000/simple'})
    uid = manager.add([FIXTURE('project1', 'requirements.txt')])

    # Given that I have a manager with a curd and an http client
    client = Server(manager, __name__).test_client()
    curd = manager.new(uid)

    # When I try to list all the available curds
    result = client.get('/')

    # Then I see that the newly created curd is available in the response list
    loads(result.data).should.equal([{
        'uid': uid,
        'url': '/{}'.format(uid),
    }])