Beispiel #1
0
 def test_daily_working_hours_attribute_is_None(self):
     """testing if the daily_working_hours attribute will be equal to the
     default settings value when it is set to None
     """
     wh = WorkingHours()
     wh.daily_working_hours = None
     self.assertEqual(wh.daily_working_hours, defaults.daily_working_hours)
 def test_daily_working_hours_attribute_is_None(self):
     """testing if the daily_working_hours attribute will be equal to the
     default settings value when it is set to None
     """
     wh = WorkingHours()
     wh.daily_working_hours = None
     self.assertEqual(wh.daily_working_hours, defaults.daily_working_hours)
def test_daily_working_hours_attribute_is_None():
    """testing if the daily_working_hours attribute will be equal to the
    default settings value when it is set to None
    """
    wh = WorkingHours()
    wh.daily_working_hours = None
    from stalker import defaults
    assert wh.daily_working_hours == defaults.daily_working_hours
def test_daily_working_hours_attribute_is_not_an_integer():
    """testing if a TypeError will be raised when the daily_working hours
    attribute is set to a value other than an integer
    """
    wh = WorkingHours()
    with pytest.raises(TypeError) as cm:
        wh.daily_working_hours = 'not an integer'

    assert str(cm.value) == \
        'WorkingHours.daily_working_hours should be an integer, not str'
def test_daily_working_hours_attribute_is_set_to_a_number_bigger_than_24():
    """testing if a ValueError will be raised when the daily working hours
    attribute value is bigger than 24
    """
    wh = WorkingHours()
    with pytest.raises(ValueError) as cm:
        wh.daily_working_hours = 25

    assert str(cm.value) == \
        'WorkingHours.daily_working_hours should be a positive integer ' \
        'value greater than 0 and smaller than or equal to 24'
def test_daily_working_hours_attribute_is_a_negative_number():
    """testing if a ValueError will be raised when the daily_working_hours
    attribute is set to a negative value
    """
    wh = WorkingHours()
    with pytest.raises(ValueError) as cm:
        wh.daily_working_hours = -10

    assert str(cm.value) == \
        'WorkingHours.daily_working_hours should be a positive integer ' \
        'value greater than 0 and smaller than or equal to 24'
Beispiel #7
0
    def test_daily_working_hours_attribute_is_not_an_integer(self):
        """testing if a TypeError will be raised when the daily_working hours
        attribute is set to a value other than an integer
        """
        wh = WorkingHours()
        with self.assertRaises(TypeError) as cm:
            wh.daily_working_hours = 'not an integer'

        self.assertEqual(
            str(cm.exception),
            'WorkingHours.daily_working_hours should be an integer, not str')
Beispiel #8
0
    def test_daily_working_hours_attribute_is_a_negative_number(self):
        """testing if a ValueError will be raised when the daily_working_hours
        attribute is set to a negative value
        """
        wh = WorkingHours()
        with self.assertRaises(ValueError) as cm:
            wh.daily_working_hours = -10

        self.assertEqual(
            str(cm.exception),
            'WorkingHours.daily_working_hours should be a positive integer '
            'value greater than 0 and smaller than or equal to 24')
Beispiel #9
0
    def test_daily_working_hours_attribute_is_set_to_a_number_bigger_than_24(
            self):
        """testing if a ValueError will be raised when the daily working hours
        attribute value is bigger than 24
        """
        wh = WorkingHours()
        with self.assertRaises(ValueError) as cm:
            wh.daily_working_hours = 25

        self.assertEqual(
            str(cm.exception),
            'WorkingHours.daily_working_hours should be a positive integer '
            'value greater than 0 and smaller than or equal to 24')
 def test_daily_working_hours_attribute_is_working_properly(self):
     """testing if the daily_working_hours attribute is working properly
     """
     wh = WorkingHours()
     wh.daily_working_hours = 23
     self.assertEqual(wh.daily_working_hours, 23)
Beispiel #11
0
 def test_daily_working_hours_attribute_is_working_properly(self):
     """testing if the daily_working_hours attribute is working properly
     """
     wh = WorkingHours()
     wh.daily_working_hours = 23
     self.assertEqual(wh.daily_working_hours, 23)
def test_daily_working_hours_attribute_is_working_properly():
    """testing if the daily_working_hours attribute is working properly
    """
    wh = WorkingHours()
    wh.daily_working_hours = 23
    assert wh.daily_working_hours == 23