Exemplo n.º 1
0
def test_hint():
	params = BoxFactory.attributes()
        box = Box(**params)
	assert box.hint() == params['levels'][0].get_hint()
Exemplo n.º 2
0
def test_creation():
        box = Box(**BoxFactory.attributes())
	assert box._levels == BoxFactory.attributes()['levels'] 
Exemplo n.º 3
0
def test_solve_failure():
	params = BoxFactory.attributes()
        box = Box(**params)
	box._levels[0].solve = Mock(return_value = False)
	assert box.solve() == False
	assert box.current_level() == 1
Exemplo n.º 4
0
def test_solve_success():
	params = BoxFactory.attributes()
        box = Box(**params)
	box._levels[0].solve = Mock(return_value = True)
	assert box.solve() == True
	assert box.current_level() == 2
Exemplo n.º 5
0
def test_message():
	params = BoxFactory.attributes()
        box = Box(**params)
	assert box.message() == params['levels'][0].message
Exemplo n.º 6
0
def test_current_level():
	params = BoxFactory.attributes()
        box = Box(**params)
	assert box.current_level() == 1
Exemplo n.º 7
0
def test_creation_fails_without_levels():
	params = BoxFactory.attributes()
	params['levels'] = []
        box = Box(**params)