Exemplo n.º 1
0
def test_requirement_export_to_ordered_dict():
    """Test :func:`planemo.training.utils.Requirement.export_to_ordered_dict`."""
    req = Requirement()
    exp_req = req.export_to_ordered_dict()
    assert 'type' in exp_req
    assert exp_req['type'] == "internal"
    assert 'topic_name' in exp_req
    assert 'link' not in exp_req
Exemplo n.º 2
0
def test_requirement_export_to_ordered_dict():
    """Test :func:`planemo.training.utils.Requirement.export_to_ordered_dict`."""
    req = Requirement()
    exp_req = req.export_to_ordered_dict()
    assert 'title' in exp_req
    assert exp_req['title'] == ""
    assert 'type' in exp_req
    assert 'link' in exp_req
Exemplo n.º 3
0
def test_requirement_init_from_dict():
    """Test :func:`planemo.training.utils.Requirement.init_from_dict`."""
    req = Requirement()
    req.init_from_dict({
        'title': 'The Requirement',
        'type': 'external',
        'link': "http://URL"
    })
    assert req.title == 'The Requirement'
    assert req.type == 'external'
    assert req.link == "http://URL"
Exemplo n.º 4
0
def test_requirement_init_from_dict():
    """Test :func:`planemo.training.utils.Requirement.init_from_dict`."""
    req = Requirement()
    req.init_from_dict({
        'title': 'The Requirement',
        'type': 'external',
        'link': "http://URL"
    })
    assert req.title == 'The Requirement'
    assert req.type == 'external'
    assert req.link == "http://URL"
Exemplo n.º 5
0
def test_requirement_init():
    """Test :func:`planemo.training.utils.Requirement.init`."""
    # test requirement with default parameter
    req = Requirement()
    assert req.title is None
    assert req.type == "internal"
    assert req.topic_name == "introduction"
    # test requirement with non default
    req = Requirement(title="Introduction", req_type="external", link="URL")
    assert req.title == "Introduction"
    assert req.type == "external"
    assert req.link == "URL"