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)
def test_answer_part_b(self): # noqa D102 result = day23.part_b(helpers.get_file_contents('day23.txt')) self.assertEqual(result, '')
def test_answer_part_a(self): # noqa D102 result = day04.part_a(helpers.get_file_contents('day04.txt')) self.assertEqual(result, '35623')
def test_answer_part_b(self): # noqa D102 result = day02.part_b(helpers.get_file_contents('day02.txt')) self.assertEqual(result, 'zihwtxagifpbsnwleydukjmqv')
def test_answer_part_a(self): # noqa D102 result = day21.part_a(helpers.get_file_contents('day21.txt')) self.assertEqual(result, '212115')
def test_answer_part_a(self): # noqa D102 result = day18.part_a(helpers.get_file_contents('day18.txt')) self.assertEqual(result, '606416')
def test_answer_part_a(self): # noqa D102 result = day10.part_a(helpers.get_file_contents('day10.txt')) self.assertEqual(result, 'ZAEZRLZG')
def test_answer_part_a(self): # noqa D102 result = day07.part_a(helpers.get_file_contents('day07.txt')) self.assertEqual(result, 'BETUFNVADWGPLRJOHMXKZQCISY')
def test_answer_part_a(self): # noqa D102 result = day19.part_a(helpers.get_file_contents('day19.txt'), optimize=True) self.assertEqual(result, '1728')