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)
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__)
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__
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
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"
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"
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")