Ejemplo n.º 1
0
def test_remove_application():
    # create a pair of applications in the manifest
    m = Manifest()
    m.create('manifest.json', 'test-guid', 'test-app-0', 'test-description',
             'overview....', 'jesseward', 'utility')
    m.add_application('test-guid', 'test-app-1', 'test-description',
                      'overview....', 'jesseward', 'utility')
    assert len(m.applications()) == 2

    # remove index 0 / application test-app-0
    m.remove_application('test-app-0')
    assert len(m.applications()) == 1
Ejemplo n.º 2
0
def test_add_application():
    m = Manifest()
    m.create('manifest.json', 'test-guid', 'test-app', 'test-description',
             'overview....', 'jesseward', 'utility')

    # attempting to add a duplicate application should trigger a look-up errors
    with pytest.raises(LookupError):
        m.add_application('test-guid', 'test-app', 'test-description',
                          'overview....', 'jesseward', 'utility')

    # add a second application and ensure it persists.
    m.add_application('test-guid', 'test-app-2', 'test-description',
                      'overview....', 'jesseward', 'utility')
    assert len(m.applications()) == 2