class TestGetApartmentsNeeded(unittest.TestCase):
    def setUp(self):
        self._calculator_obj_one = Calculator(150000, 70000, 2019, 80000, 6666)
        self._calculator_obj_two = Calculator(150000, 80000, 2019, 80000, 6666)
        self._calculator_obj_three = Calculator(150000, 90000, 2019, 80000,
                                                6666)

    def test_apartments_needed_easy_first(self):
        self.assertEqual(self._calculator_obj_one.get_apartments_needed(), 23)

    def test_apartments_needed_easy_second(self):
        self.assertEqual(self._calculator_obj_two.get_apartments_needed(), 24)

    def test_apartments_needed_easy_third(self):
        self.assertEqual(self._calculator_obj_three.get_apartments_needed(),
                         23)

    def test_apartments_needed_medium_first(self):
        pass

    def test_apartments_needed_medium_second(self):
        pass

    def test_apartments_needed_medium_third(self):
        pass

    def test_apartments_needed_hard_first(self):
        pass

    def test_apartments_needed_hard_second(self):
        pass

    def test_apartments_needed_hard_third(self):
        pass
Example #2
0
class TestGetApartmentsNeeded(unittest.TestCase):
    def setUp(self):
        self._calculator_obj_one = Calculator(150000, 70000, 2019, 80000, 6666)
        self._calculator_obj_two = Calculator(150000, 80000, 2019, 80000, 6666)
        self._calculator_obj_three = Calculator(150000, 90000, 2019, 80000,
                                                6666)

    @unittest.skipIf(int(sys.version[0]) > 2, "needs to be version 4"
                     )  # skip z warunkiem dla wersji pythona
    def test_apartments_needed_easy_first(self):
        self.assertEqual(self._calculator_obj_one.get_apartments_needed(), 23)

    # test BEDZIE sie uruchamiac TYLKO na windzie
    @unittest.skipUnless(sys.platform.startswith("win"), "Requires Windows"
                         )  #skip ze wzgledu na system operacyjny
    def test_apartments_needed_easy_second(self):
        self.assertEqual(self._calculator_obj_two.get_apartments_needed(), 24)

    @unittest.expectedFailure  #uzywac tylko gdy
    def test_apartments_needed_easy_third(self):
        self.assertEqual(self._calculator_obj_three.get_apartments_needed(),
                         23)

    def test_apartments_needed_medium_first(self):
        pass

    def test_apartments_needed_medium_second(self):
        pass

    def test_apartments_needed_medium_third(self):
        pass

    def test_apartments_needed_hard_first(self):
        pass

    def test_apartments_needed_hard_second(self):
        pass

    def test_apartments_needed_hard_third(self):
        pass