Exemplo n.º 1
0
 def test_gap_unit_attribute_is_working_properly(self):
     """testing if the gap_unit attribute is working properly
     """
     tdep = TaskDependency(**self.kwargs)
     test_value = 'w'
     self.assertNotEqual(tdep.gap_unit, test_value)
     tdep.gap_unit = test_value
     self.assertEqual(tdep.gap_unit, test_value)
Exemplo n.º 2
0
 def test_gap_unit_attribute_is_working_properly(self):
     """testing if the gap_unit attribute is working properly
     """
     tdep = TaskDependency(**self.kwargs)
     test_value = 'w'
     self.assertNotEqual(tdep.gap_unit, test_value)
     tdep.gap_unit = test_value
     self.assertEqual(tdep.gap_unit, test_value)
Exemplo n.º 3
0
 def test_gap_unit_attribute_is_None(self):
     """testing if the default value will be used when the gap_unit
     attribute is set to None
     """
     tdep = TaskDependency(**self.kwargs)
     tdep.gap_unit = None
     self.assertEqual(tdep.gap_unit,
                      TaskDependency.__default_schedule_unit__)
Exemplo n.º 4
0
 def test_gap_unit_attribute_is_None(self):
     """testing if the default value will be used when the gap_unit
     attribute is set to None
     """
     tdep = TaskDependency(**self.kwargs)
     tdep.gap_unit = None
     self.assertEqual(tdep.gap_unit,
                      TaskDependency.__default_schedule_unit__)
Exemplo n.º 5
0
 def test_gap_unit_attribute_is_None(self):
     """testing if the default value will be used when the gap_unit
     attribute is set to None
     """
     from stalker import TaskDependency
     tdep = TaskDependency(**self.kwargs)
     tdep.gap_unit = None
     assert tdep.gap_unit == TaskDependency.__default_schedule_unit__
Exemplo n.º 6
0
 def test_gap_unit_attribute_is_working_properly(self):
     """testing if the gap_unit attribute is working properly
     """
     from stalker import TaskDependency
     tdep = TaskDependency(**self.kwargs)
     test_value = 'w'
     assert tdep.gap_unit != test_value
     tdep.gap_unit = test_value
     assert tdep.gap_unit == test_value
Exemplo n.º 7
0
    def test_gap_unit_attribute_value_is_not_in_the_enum_list(self):
        """testing if a ValueError will be raised when the gap_unit attribute
        value is not one of ['min', 'h', 'd', 'w', 'm', 'y']
        """
        from stalker import TaskDependency
        tdep = TaskDependency(**self.kwargs)
        with pytest.raises(ValueError) as cm:
            tdep.gap_unit = 'not in the list'

        assert str(cm.value) == \
            "TaskDependency.gap_unit should be a string value one of " \
            "['min', 'h', 'd', 'w', 'm', 'y'] showing the unit of the gap " \
            "timing of this TaskDependency, not str"
Exemplo n.º 8
0
    def test_gap_unit_attribute_is_not_a_string_instance(self):
        """testing if a TypeError will be raised when the gap_unit attribute
        is not a string
        """
        from stalker import TaskDependency
        tdep = TaskDependency(**self.kwargs)
        with pytest.raises(TypeError) as cm:
            tdep.gap_unit = 2342

        assert str(cm.value) == \
            "TaskDependency.gap_unit should be a string value one of " \
            "['min', 'h', 'd', 'w', 'm', 'y'] showing the unit of the gap " \
            "timing of this TaskDependency, not int"
Exemplo n.º 9
0
    def test_gap_unit_attribute_is_not_a_string_instance(self):
        """testing if a TypeError will be raised when the gap_unit attribute
        is not a string
        """
        from stalker import TaskDependency
        tdep = TaskDependency(**self.kwargs)
        with self.assertRaises(TypeError) as cm:
            tdep.gap_unit = 2342

        self.assertEqual(
            str(cm.exception),
            "TaskDependency.gap_unit should be a string value one of ['min', "
            "'h', 'd', 'w', 'm', 'y'] showing the unit of the gap timing of "
            "this TaskDependency, not int")