示例#1
0
def test_sample1(monkeypatch, capsys):
    """Using Sample Run 1 values, this test case checks for 31 in your program's output."""
    monkeypatch.setattr('builtins.input', mock_sample1_input)
    prompts.clear()
    inputs.clear()

    Calendar.main()
    output = capsys.readouterr().out
    assert "31" in output
示例#2
0
def lob():
    solutions = sol.main(toMatrix(board))
    for i in range(solutions[2]):
        global solution
        solu = solutions[1][i]
        empty_index = board.index(EMPTY_SQUARE)
        if solu == 'R':
            board_index = empty_index - 1
        elif solu == 'L':
            board_index = empty_index + 1
        elif solu == 'U':
            board_index = empty_index + 4
        elif solu == 'D':
            board_index = empty_index - 4
        empty_index = get_empty_neighbor(board_index)
        board[board_index], board[empty_index] = board[empty_index], board[
            board_index]
        solution.append(board[empty_index]
                        ) if board[empty_index] != 16 else solution.append(0)
        draw_board()
        if board == correct_board:
            print(solution)
            show_victory_plate()
        root.after(500)
        root.update()
示例#3
0
 def test_large(self):
     self.assertEqual("5537376230390876637302048746832985971773659831892672", sol.main(thisDir + "/input"))
示例#4
0
 def test_1(self):
     self.assertEqual(13, sol.main(6))
示例#5
0
 def test_2(self):
     self.assertEqual(232792560, sol.main(20))
示例#6
0
 def test_sol_small(self):
     self.assertEqual(101, sol.main(5))
示例#7
0
 def test_sol_4(self):
     self.assertEqual(19316, sol.main(4))
示例#8
0
 def test_12(self):
     self.assertEqual(60, sol.main(12))
示例#9
0
 def test_main(self):
     self.assertEqual(171, sol.main(1901, 2000))
示例#10
0
 def test_small(self):
     self.assertEqual(2427, sol.main(thisDir + "/input_small"))
示例#11
0
 def test_221(self):
     self.assertEqual(220, sol.main(221))
示例#12
0
 def test_10000(self):
     self.assertEqual(31626, sol.main(10000))
示例#13
0
 def test_1(self):
     self.assertEqual(4613732, sol.main(4e6))
示例#14
0
 def test_2(self):
     self.assertEqual(25164150, sol.main(100))
示例#15
0
 def test_2(self):
     self.assertEqual(142913828922, sol.main(2e6))
示例#16
0
 def test_1(self):
     self.assertEqual(70600674, sol.main(thisDir + "/input"))
示例#17
0
 def test_sol(self):
     self.assertEqual(4179871, sol.main())
示例#18
0
 def test_count_10(self):
     self.assertEqual(27, sol.main(10))
示例#19
0
 def test_count_15(self):
     self.assertEqual(26, sol.main(15))
示例#20
0
def test_sol_213():
    assert sol.main([2, 1, 3]) == 10
示例#21
0
def test_sol_123():
    assert sol.main([1, 2, 3]) == 27
示例#22
0
 def test_sol_5(self):
     self.assertEqual(443839, sol.main(5))
示例#23
0
def test_sol_231():
    assert sol.main([2, 3, 1]) == 78
示例#24
0
 def test_sol(self):
     self.assertEqual(669171001, sol.main(1001))
示例#25
0
def test_sol_321():
    assert sol.main([3, 2, 1]) == 438
示例#26
0
 def test_2(self):
     self.assertEqual(104743, sol.main(10001))
示例#27
0
def test_sol_312():
    assert sol.main([3, 1, 2]) == 1836
示例#28
0
 def test_main(self):
     self.assertEqual(21124, sol.main(1000))
示例#29
0
def test_sol_036():
    assert sol.main([0, 3, 6]) == 436
示例#30
0
 def test_2(self):
     self.assertEqual(233168, sol.main(1000))
示例#31
0
def test_sol_132():
    assert sol.main([1, 3, 2]) == 1
示例#32
0
 def test_1(self):
     self.assertEqual(17, sol.main(10))
示例#33
0
 def test_count_2(self):
     self.assertEqual(6, sol.main(2, 2))
示例#34
0
 def test_1(self):
     self.assertEqual(40824, sol.main(thisDir + "/input"))
示例#35
0
 def test_count_20(self):
     self.assertEqual(137846528820, sol.main(20, 20))
示例#36
0
 def test_count_100(self):
     self.assertEqual(648, sol.main(100))
示例#37
0
 def test_count_1(self):
     self.assertEqual(2, sol.main(1, 1))
示例#38
0
 def test_sol(self):
     self.assertEqual("2783915460", sol.main(9, 1e6))
示例#39
0
 def test_1000(self):
     self.assertEqual(31875000, sol.main(1000))