Exemplo n.º 1
0
    def test_static_values(self):

        for input_path, output_path, (test_place, test_value) in zip(
                self.test_input, self.test_output, self.test_data_output):
            main(self.test_learning, input_path, output_path, sample=False)

            with open(output_path, 'r') as test_out:
                output = test_out.readline().split('\t')
                place, value = output[:2]

                self.assertTrue(test_place in place)
                self.assertAlmostEqual(test_value, float(value), places=3)
Exemplo n.º 2
0
 def test_part2(self):
     assert part2.main() == 58534
Exemplo n.º 3
0
 def test_zero(self):
     main(self.test_learning, 'test/5', 'test/5out', sample=False)
     with open('test/5out', 'r') as test_out:
         output = test_out.readline().split('\t')
         self.assertEqual(output, ['', '', ''])
Exemplo n.º 4
0
 def test_part2_scenario1(self):
     assert part2.main('./scratch2.txt') == 396
Exemplo n.º 5
0
## IMPORTANT: DO NOT EDIT THIS FILE ##

import part1
import part2
import part3

not_done = True
while not_done:
    trying = input("Which file would you like to run?\n")
    not_done = False
    if trying == "part1":
        part1.main()
    elif trying == "part2":
        part2.main()
    elif trying == "part3":
        part3.main()
    else:
        not_done = True
        print("Invalid file, please try again.")
Exemplo n.º 6
0
 def test_part2_scenario0(self):
     assert part2.main('./scratch.txt') == 26
Exemplo n.º 7
0
 def test_part2(self):
     assert part2.main() is None
Exemplo n.º 8
0
 def test_part2_scenario4(self):
     assert part2.main('./scratch2-4.txt') == 72
Exemplo n.º 9
0
 def test_part2_scenario3(self):
     assert part2.main('./scratch2-3.txt') == 32
Exemplo n.º 10
0
 def test_part2_scenario2(self):
     assert part2.main('./scratch2-2.txt') == 24
Exemplo n.º 11
0
 def test_part2_scenario3(self):
     assert part2.main('./scratch3.txt') == 5586022