Ejemplo n.º 1
0
def test_create_library_id(client_mock, config):
    """Create a new library in the store."""
    store = Store(config.charmhub)
    client_mock.post.return_value = {'library-id': 'test-lib-id'}

    result = store.create_library_id('test-charm-name', 'test-lib-name')

    assert client_mock.mock_calls == [
        call.post('/v1/charm/libraries/test-charm-name', {'library-name': 'test-lib-name'}),
    ]
    assert result == 'test-lib-id'
Ejemplo n.º 2
0
def test_create_library_id(client_mock, config):
    """Create a new library in the store."""
    store = Store(config.charmhub)
    client_mock.post.return_value = {"library-id": "test-lib-id"}

    result = store.create_library_id("test-charm-name", "test-lib-name")

    assert client_mock.mock_calls == [
        call.post("/v1/charm/libraries/test-charm-name",
                  {"library-name": "test-lib-name"}),
    ]
    assert result == "test-lib-id"