예제 #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)
예제 #2
0
 def test_part2(self):
     assert part2.main() == 58534
예제 #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, ['', '', ''])
예제 #4
0
 def test_part2_scenario1(self):
     assert part2.main('./scratch2.txt') == 396
예제 #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.")
예제 #6
0
 def test_part2_scenario0(self):
     assert part2.main('./scratch.txt') == 26
예제 #7
0
 def test_part2(self):
     assert part2.main() is None
예제 #8
0
 def test_part2_scenario4(self):
     assert part2.main('./scratch2-4.txt') == 72
예제 #9
0
 def test_part2_scenario3(self):
     assert part2.main('./scratch2-3.txt') == 32
예제 #10
0
 def test_part2_scenario2(self):
     assert part2.main('./scratch2-2.txt') == 24
예제 #11
0
 def test_part2_scenario3(self):
     assert part2.main('./scratch3.txt') == 5586022