예제 #1
0
def test_constraint_contains():
    lcs = LineupConstraints()
    lcs.add_group_constraint(['A', 'B'], 1)
    lcs.ban(['C'])
    lcs.add_group_constraint(['E', 'F', 'G'], (1, 3))
    lcs.lock(['H'])

    for c in ['A', 'B', 'C', 'E', 'F', 'G', 'H']:
        ntools.assert_equal(c in lcs, True)
예제 #2
0
def test_build_constraint_set():
    lcs = LineupConstraints()
    lcs.add_group_constraint(['Spencer Ware', 'Amari Cooper'], 1)
    lcs.ban(['Packers'])
    lcs.add_group_constraint(['Eli Manning', 'Russell Wilson', 'Doug Martin'],
                             (1, 3))
    lcs.lock(['Will Fuller'])

    ntools.assert_equal(len(lcs), 4)
예제 #3
0
def test_bad_group_duplicate_bounds():
    lcs = LineupConstraints()
    lcs.add_group_constraint(['Spencer Ware', 'Amari Cooper'], (1, 1))
예제 #4
0
def test_bad_group_shadow_ban_hi_lo_bound():
    lcs = LineupConstraints()
    lcs.add_group_constraint(['Spencer Ware', 'Amari Cooper'], (0, 0))
예제 #5
0
def test_dup_group_rule2():
    lcs = LineupConstraints()
    lcs.add_group_constraint(['Eli Manning', 'Russell Wilson', 'Doug Martin'],
                             (1, 2))
    lcs.add_group_constraint(['Eli Manning', 'Russell Wilson', 'Doug Martin'],
                             (1, 2))
예제 #6
0
def test_dup_group_rule():
    lcs = LineupConstraints()
    lcs.add_group_constraint(['Spencer Ware', 'Amari Cooper'], 1)
    lcs.add_group_constraint(['Spencer Ware', 'Amari Cooper'], 1)
예제 #7
0
def test_group_ban_conflict():
    lcs = LineupConstraints()
    lcs.add_group_constraint(['Eli Manning', 'Doug Martin'], (1, 2))
    lcs.ban(['Eli Manning'])
예제 #8
0
def test_empty_group():
    lcs = LineupConstraints()
    lcs.add_group_constraint([], 1)
예제 #9
0
def test_single_player_group():
    lcs = LineupConstraints()
    lcs.add_group_constraint(['Spencer Ware'], 1)
예제 #10
0
def test_bad_group_too_many_bounds():
    lcs = LineupConstraints()
    lcs.add_group_constraint(['Spencer Ware', 'Amari Cooper'], (1, 1, 2))
예제 #11
0
def test_bad_group_bounds_type():
    lcs = LineupConstraints()
    lcs.add_group_constraint(['Spencer Ware', 'Amari Cooper'], '1')
예제 #12
0
def test_bad_group_dup_player():
    lcs = LineupConstraints()
    lcs.add_group_constraint(['Amari Cooper', 'Amari Cooper'], 1)
예제 #13
0
def test_bad_group_max_set():
    lcs = LineupConstraints()
    lcs.add_group_constraint(['Spencer Ware', 'Amari Cooper'], (1, 3))
예제 #14
0
def test_bad_group_zero_min():
    lcs = LineupConstraints()
    lcs.add_group_constraint(['Spencer Ware', 'Amari Cooper'], (0, 1))
예제 #15
0
def test_bad_group_negative_min():
    lcs = LineupConstraints()
    lcs.add_group_constraint(['Spencer Ware', 'Amari Cooper'], (-1, 1))