Esempio n. 1
0
    def asserted_modify_file(self, filename, contents, message="testing modify"):
        """
        Modify a file whilst making assertions.

        pre-asserts the file exists, post asserts that the file has the new content
        and that the response code from the http server was 200
        """

        self.assertFileExistsInProject(filename)
        response = self.get_save_file_endpoint(filename, contents, self.rev, message)
        self.rev += 1
        actual_file_contents = helpers.get_file_contents(filename, self.team, self.project_name)
        self.assertEqual(actual_file_contents,
                         contents,
                         "file did not match expected contents \"%s\" actual contents were \"%s\"" % (contents, actual_file_contents))
        self.assertResponseCode200(response.status)
Esempio n. 2
0
 def test_answer_part_b(self):  # noqa D102
     result = day23.part_b(helpers.get_file_contents('day23.txt'))
     self.assertEqual(result, '')
Esempio n. 3
0
 def test_answer_part_a(self): # noqa D102
     result = day04.part_a(helpers.get_file_contents('day04.txt'))
     self.assertEqual(result, '35623')
Esempio n. 4
0
 def test_answer_part_b(self):  # noqa D102
     result = day02.part_b(helpers.get_file_contents('day02.txt'))
     self.assertEqual(result, 'zihwtxagifpbsnwleydukjmqv')
Esempio n. 5
0
 def test_answer_part_a(self):  # noqa D102
     result = day21.part_a(helpers.get_file_contents('day21.txt'))
     self.assertEqual(result, '212115')
Esempio n. 6
0
 def test_answer_part_a(self):  # noqa D102
     result = day18.part_a(helpers.get_file_contents('day18.txt'))
     self.assertEqual(result, '606416')
Esempio n. 7
0
 def test_answer_part_a(self):  # noqa D102
     result = day10.part_a(helpers.get_file_contents('day10.txt'))
     self.assertEqual(result, 'ZAEZRLZG')
Esempio n. 8
0
 def test_answer_part_a(self):  # noqa D102
     result = day07.part_a(helpers.get_file_contents('day07.txt'))
     self.assertEqual(result, 'BETUFNVADWGPLRJOHMXKZQCISY')
Esempio n. 9
0
 def test_answer_part_a(self): # noqa D102
     result = day19.part_a(helpers.get_file_contents('day19.txt'), optimize=True)
     self.assertEqual(result, '1728')