def test_get_row_implementors_just_one(self):
     row = [1] * len(BASE_HEADERS) + ["Main Contractor: C"]
     offset = len(BASE_HEADERS)
     implementor_column_indexes = list(range(offset, offset + 1))
     implementors = get_row_implementors(row, implementor_column_indexes)
     self.assertEqual(implementors[0], "")
     self.assertEqual(implementors[1], "")
     self.assertEqual(implementors[2], "C")
     self.assertEqual(implementors[3], "")
 def test_get_row_implementors(self):
     """Regardless of order in input, they are output in IMPLEMENTOR_HEADERS order"""
     row = [1] * len(BASE_HEADERS) + [
         "Main Contractor: C",
         "Principal Agent: B",
         "Program Implementing Agent: A",
         "Unexpected Implementor: D",
     ]
     offset = len(BASE_HEADERS)
     implementor_column_indexes = list(range(offset, offset + 4))
     implementors = get_row_implementors(row, implementor_column_indexes)
     self.assertEqual(implementors[0], "A")
     self.assertEqual(implementors[1], "B")
     self.assertEqual(implementors[2], "C")
     self.assertEqual(implementors[3], "Unexpected Implementor: D")
 def test_get_row_implementors_blanks(self):
     row = [1] * len(BASE_HEADERS) + [
         "Main Contractor: C",
         "",
         "Principal Agent: B",
         None,
         "Program Implementing Agent: A",
         "",
         "Unexpected Implementor: D",
     ]
     offset = len(BASE_HEADERS)
     implementor_column_indexes = list(range(offset, offset + 7))
     implementors = get_row_implementors(row, implementor_column_indexes)
     self.assertEqual(implementors[0], "A")
     self.assertEqual(implementors[1], "B")
     self.assertEqual(implementors[2], "C")
     self.assertEqual(implementors[3], "Unexpected Implementor: D")
 def test_get_row_implementors_multiple(self):
     row = [1] * len(BASE_HEADERS) + [
         "Main Contractor: A",
         "Main Contractor: B",
         "Principal Agent: C",
         "Principal Agent: D",
         "Program Implementing Agent: E",
         "Program Implementing Agent: F",
         "Unexpected Implementor: G",
         "Unexpected Something: H",
     ]
     offset = len(BASE_HEADERS)
     implementor_column_indexes = list(range(offset, offset + 8))
     implementors = get_row_implementors(row, implementor_column_indexes)
     self.assertEqual(implementors[0], "E\nF")  # Prog Impl Agent
     self.assertEqual(implementors[1], "C\nD")  # Principal Agent
     self.assertEqual(implementors[2], "A\nB")  # Main Contractor
     self.assertEqual(
         implementors[3], "Unexpected Implementor: G\nUnexpected Something: H"
     )