Пример #1
0
 def _instantiate_employee(
         self, employe_id='1', vertical="vert1", project='proj1',
         position='pos1', name='name1', table='0',
         room='Remote', location='loc1'):
     """
     Instantiate class Employee with parameters passed
     :return: Employee instance
     """
     data = [employe_id, vertical, project, position,
             name, table, room, location]
     return list_to_employee(data)
Пример #2
0
    def _check_employee_to_list(
            self, employee_id=1, vertical="vert1", project='proj1',
            position='pos1', name='name1', table='0',
            room='Remote', location='loc1'):
        """Check if object returned by employee_to_list has correct data"""

        data = [employee_id, vertical, project, position,
                name, table, room, location]
        employee = list_to_employee(data)
        self.assertEqual(data, employee_to_list(employee))
        return employee_to_list(employee)
Пример #3
0
 def _check_list_to_employee(
         self, employee_id=1, vertical="vert1", project='proj1',
         position='pos1', name='name1', table='0',
         room='Remote', location='loc1'):
     """Check if object returned by list_to_employee has correct data
     :return Employee instance
     """
     data = [employee_id, vertical, project, position,
             name, table, room, location]
     employee = list_to_employee(data)
     self.assertEqual(employee_id, employee.id_sse)
     self.assertEqual(vertical, employee.vertical)
     self.assertEqual(project, employee.project)
     self.assertEqual(position, employee.position)
     self.assertEqual(name, employee.name)
     return employee
Пример #4
0
 def test_not_iterable_input(self):
     """Check if passing not iterable object raises WrongParameterError"""
     with self.assertRaises(WrongParameterError):
         list_to_employee(123)
Пример #5
0
 def test_invalid_input(self):
     """Check if passing list of wrong length raises WrongParameterError"""
     with self.assertRaises(WrongParameterError):
         list_to_employee(['4', '5'])
Пример #6
0
 def test_empty_input(self):
     """Check if passing empty list raises WrongParameterError"""
     with self.assertRaises(WrongParameterError):
         list_to_employee([])