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