Exemplo n.º 1
0
class TestWorker(unittest.TestCase):

    def setUp(self):
        self.worker1 = Employee('Bartosz', 'Chojnacki', 10000)
        self.year_sum = [15000, 17000]

    def test_give_default_raise(self):
        self.worker1.give_raise()
        self.assertEqual(self.year_sum[0], self.worker1.year_revenue)

    def test_give_custom_raise(self):
        self.worker1.give_raise(7000)
        self.assertEqual(self.year_sum[1], self.worker1.year_revenue)
Exemplo n.º 2
0
class WorkerTestCase(unittest.TestCase):
	"""Тесты для Employee."""
	def setUp(self):
		"""Создание экземпляра Employee и ответов."""
		self.worker = Employee('danil', 'lomakin', 120000)

	def test_give_default_raise(self):
		self.worker.give_raise()
		self.assertEqual(self.worker.salary, 125000)

	def test_give_custom_raise(self):
		self.worker.give_raise(10000)
		self.assertEqual(self.worker.salary, 130000)
Exemplo n.º 3
0
class TestEmployee(unittest.TestCase):
    """Тесты для класса Employee"""

    def setUp(self):
        """Создание работника для использования в тестах"""
        self.alex = Employee('alex', 'lutai', 1000)

    def test_give_default_raise(self):
        """Тест который проверяет надбавку по умолчанию"""
        self.alex.give_raise()
        self.assertEqual(self.alex.salary, 6000)

    def test_give_custom_raise(self):
        """Тест который проверяет любую надбавку"""
        self.alex.give_raise(7000)
        self.assertEqual(self.alex.salary, 8000)
Exemplo n.º 4
0
class TestEmployee(unittest.TestCase):
    def setUp(self):
        self.first_name = 'neal'
        self.last_name = 'oaken'
        self.worker = Employee(self.first_name, self.last_name)

    def test_change_data_user(self):
        self.worker.change_data_user(self.first_name, self.last_name)
        self.assertIn(self.worker, self.worker)

    def test_set_annual_salary(self):
        pass

    def test_increase_annual_salary(self):
        pass

    def test_show_employee_value(self):
        self.worker.show_employee_value

    def test_city_country(self):
        out_result = get_format_city('usa', 'new york')
        self.assertEqual(out_result, 'Usa, New York')
Exemplo n.º 5
0
	def setUp(self):
		"""Создание экземпляра Employee и ответов."""
		self.worker = Employee('danil', 'lomakin', 120000)
Exemplo n.º 6
0
 def setUp(self):
     self.worker1 = Employee('Bartosz', 'Chojnacki', 10000)
     self.year_sum = [15000, 17000]
Exemplo n.º 7
0
 def setUp(self):
     """Создание работника для использования в тестах"""
     self.alex = Employee('alex', 'lutai', 1000)
Exemplo n.º 8
0
 def setUp(self):
     self.first_name = 'neal'
     self.last_name = 'oaken'
     self.worker = Employee(self.first_name, self.last_name)