Example #1
0
def test_set_is_accepted_with_value_unchanged():
    p = create_example_publication(accepted=False)
    p.set_is_accepted(False)
    assert not p.is_accepted()

    p = create_example_publication(accepted=True)
    p.set_is_accepted(True)
    assert p.is_accepted()
Example #2
0
def test_set_is_accepted_with_truth_base():
    p = create_example_publication(accepted=True)
    p.set_is_accepted(False)
    assert not p.is_accepted()
Example #3
0
def test_set_is_accepted_with_false_base():
    p = create_example_publication(accepted=False)
    p.set_is_accepted(True)
    assert p.is_accepted()
Example #4
0
def test_set_author():
    a = create_example_author()
    p = create_example_publication()
    assert p.get_author() is None
    p.set_author(a)
    assert p.get_author() == a
Example #5
0
def test_get_points():
    assert create_example_publication(points=69.0).get_points() == 69.0
Example #6
0
def test_get_rate():
    assert create_example_publication(points=100.0, contrib=2.0).get_rate() == 50.0
Example #7
0
def test_get_contribution():
    assert create_example_publication(contrib=2.0).get_contribution() == 2.0
Example #8
0
def test_get_id():
    assert create_example_publication(publication_id="xxx").get_id() == "xxx"
Example #9
0
def test_get_author():
    a = create_example_author()
    p = create_example_publication(author=a)
    assert p.get_author() == a
Example #10
0
def test_is_monograph_with_false():
    assert not create_example_publication(is_mono=False).is_monograph()
Example #11
0
def test_is_monograph_with_true():
    assert create_example_publication(is_mono=True).is_monograph()
Example #12
0
def test_is_accepted_with_false():
    assert not create_example_publication(accepted=False).is_accepted()
Example #13
0
def test_is_accepted_with_true():
    assert create_example_publication(accepted=True).is_accepted()