old_contents: """Advent of Code 2018 Day 1: Chronal Calibration"""
  
  import pytest
  
  
  PART_ONE_CASES = [
      ('+1\n+1\n+1', 3),
      ('+1\n+1\n-2', 0),
      ('-1\n-2\n-3', -6),
  ]
  
  
  @pytest.mark.parametrize('puzzle_input,expected', PART_ONE_CASES)
  def test_solve(puzzle_input, expected):
      assert solve(puzzle_input) == expected
  
  
  @pytest.mark.parametrize('puzzle_input,parsed', zip(
      (case_input for case_input, expected in PART_ONE_CASES),
      ([1, 1, 1], [1, 1, -2], [-1, -2, -3])
  ))
  def test_parse(puzzle_input, parsed):
      assert parse(puzzle_input) == parsed
  
  
  def parse(puzzle_input):
      """Parses puzzle input into a list of ints"""
      return [int(n) for n in puzzle_input.splitlines()]
  
  
  def solve(puzzle_input):
      """Return the sum of the frequency changes listed in input"""
      frequency_changes = parse(puzzle_input)
      return sum(frequency_changes)
  
  
  if __name__ == '__main__':
      with open('../input/2018-01.txt') as input_file:
          puzzle_input = input_file.read()
      part_one_solution = solve(puzzle_input)
      print('Part one:', part_one_solution)
  
new_contents: """Advent of Code 2018 Day 1: Chronal Calibration"""
  
  import aoc_common
  import pytest
  
  DAY = 1
  
  PART_ONE_CASES = [
      ('+1\n+1\n+1', 3),
      ('+1\n+1\n-2', 0),
      ('-1\n-2\n-3', -6),
  ]
  
  
  @pytest.mark.parametrize('puzzle_input,expected', PART_ONE_CASES)
  def test_solve(puzzle_input, expected):
      assert solve(puzzle_input) == expected
  
  
  @pytest.mark.parametrize('puzzle_input,parsed', zip(
      (case_input for case_input, expected in PART_ONE_CASES),
      ([1, 1, 1], [1, 1, -2], [-1, -2, -3])
  ))
  def test_parse(puzzle_input, parsed):
      assert parse(puzzle_input) == parsed
  
  
  def parse(puzzle_input):
      """Parses puzzle input into a list of ints"""
      return [int(n) for n in puzzle_input.splitlines()]
  
  
  def solve(puzzle_input):
      """Return the sum of the frequency changes listed in input"""
      frequency_changes = parse(puzzle_input)
      return sum(frequency_changes)
  
  
  if __name__ == '__main__':
      puzzle_input = aoc_common.load_puzzle_input(DAY)
      part_one_solution = solve(puzzle_input)
      print('Part one:', part_one_solution)
  
subject: Use input-loading utility function