old_contents: from flattening_ocds.input import unflatten_line, SpreadsheetInput, unflatten
  
  
  def test_unflatten_line():
      # Check flat fields remain flat
      assert unflatten_line({'a': 1, 'b': 2}) == {'a': 1, 'b': 2}
      assert unflatten_line({'a/b': 1, 'a/c': 2, 'd/e': 3}) == {'a': {'b': 1, 'c': 2}, 'd': {'e': 3}}
      # Check more than two levels of nesting, and that multicharacter fields aren't broken
      assert unflatten_line({'fieldA/b/c/d': 'value'}) == {'fieldA': {'b': {'c': {'d': 'value'}}}}
  
  
new_contents: from flattening_ocds.input import unflatten_line, SpreadsheetInput, unflatten
  
  
  class ListInput(SpreadsheetInput):
      def __init__(self, sheets, **kwargs):
          self.sheets = sheets
          super(ListInput, self).__init__(**kwargs)
  
      def get_sheet_lines(self, sheet_name):
          print(sheet_name)
          return self.sheets[sheet_name]
  
      def read_sheets(self):
          self.sub_sheet_names = list(self.sheets.keys()).remove(self.main_sheet_name)
  
  
  def test_unflatten_line():
      # Check flat fields remain flat
      assert unflatten_line({'a': 1, 'b': 2}) == {'a': 1, 'b': 2}
      assert unflatten_line({'a/b': 1, 'a/c': 2, 'd/e': 3}) == {'a': {'b': 1, 'c': 2}, 'd': {'e': 3}}
      # Check more than two levels of nesting, and that multicharacter fields aren't broken
      assert unflatten_line({'fieldA/b/c/d': 'value'}) == {'fieldA': {'b': {'c': {'d': 'value'}}}}
  
  
  class TestUnflatten(object):
      def test_main_sheet_flat(self):
          spreadsheet_input = ListInput(
              sheets={
                  'custom_main': [
                      {
                          'ocid': 1,
                          'id': 2,
                          'testA': 3,
                      }
                  ]
              },
              main_sheet_name='custom_main')
          spreadsheet_input.read_sheets()
          assert list(unflatten(spreadsheet_input)) == [
              {'ocid': 1, 'id': 2, 'testA': 3}
          ]
  
      def test_main_sheet_nonflat(self):
          spreadsheet_input = ListInput(
              sheets={
                  'custom_main': [
                      {
                          'ocid': 1,
                          'id': 2,
                          'testA/testB': 3,
                          'testA/testC': 4,
                      }
                  ]
              },
              main_sheet_name='custom_main')
          spreadsheet_input.read_sheets()
          assert list(unflatten(spreadsheet_input)) == [
              {'ocid': 1, 'id': 2, 'testA': {'testB': 3, 'testC': 4}}
          ]
  
subject: Add some unit tests of the unflatten function