Ejemplo n.º 1
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)
Ejemplo n.º 2
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)
Ejemplo n.º 3
0
def test_constraint_string_args():
    lcs = LineupConstraints()
    lcs.ban('Sam Bradford')
    lcs.lock('Will Fuller')
    ntools.assert_equal(len(lcs), 2)
Ejemplo n.º 4
0
def test_group_lock_conflict():
    lcs = LineupConstraints()
    lcs.add_group_constraint(['Eli Manning', 'Doug Martin'], (1, 2))
    lcs.lock(['Eli Manning'])
Ejemplo n.º 5
0
def test_lock_ban_conflict():
    lcs = LineupConstraints()
    lcs.ban(['Will Fuller'])
    lcs.lock(['Will Fuller'])
Ejemplo n.º 6
0
def test_empty_lock():
    lcs = LineupConstraints()
    lcs.lock([])