예제 #1
0
 def test_gap_model_attribute_is_working_properly(self):
     """testing if the gap_model attribute is working properly
     """
     tdep = TaskDependency(**self.kwargs)
     test_value = 'duration'
     self.assertNotEqual(tdep.gap_model, test_value)
     tdep.gap_model = test_value
     self.assertEqual(tdep.gap_model, test_value)
예제 #2
0
 def test_gap_model_attribute_is_working_properly(self):
     """testing if the gap_model attribute is working properly
     """
     tdep = TaskDependency(**self.kwargs)
     test_value = 'duration'
     self.assertNotEqual(tdep.gap_model, test_value)
     tdep.gap_model = test_value
     self.assertEqual(tdep.gap_model, test_value)
예제 #3
0
 def test_gap_model_attribute_is_None(self):
     """testing if the default value will be used when the gap_model
     attribute is set to None
     """
     tdep = TaskDependency(**self.kwargs)
     tdep.gap_model = None
     self.assertEqual(tdep.gap_model,
                      defaults.task_dependency_gap_models[0])
예제 #4
0
 def test_gap_model_attribute_is_None(self):
     """testing if the default value will be used when the gap_model
     attribute is set to None
     """
     tdep = TaskDependency(**self.kwargs)
     tdep.gap_model = None
     self.assertEqual(tdep.gap_model,
                      defaults.task_dependency_gap_models[0])
예제 #5
0
 def test_gap_model_attribute_is_None(self):
     """testing if the default value will be used when the gap_model
     attribute is set to None
     """
     from stalker import defaults, TaskDependency
     tdep = TaskDependency(**self.kwargs)
     tdep.gap_model = None
     assert tdep.gap_model == defaults.task_dependency_gap_models[0]
예제 #6
0
 def test_gap_model_attribute_is_working_properly(self):
     """testing if the gap_model attribute is working properly
     """
     from stalker import TaskDependency
     tdep = TaskDependency(**self.kwargs)
     test_value = 'duration'
     assert tdep.gap_model != test_value
     tdep.gap_model = test_value
     assert tdep.gap_model == test_value
예제 #7
0
    def test_gap_model_attribute_value_is_not_in_the_enum_list(self):
        """testing if a ValueError will be raised when the gap_model attribute
        value is not one of ['duration', 'length']
        """
        from stalker import TaskDependency
        tdep = TaskDependency(**self.kwargs)
        with pytest.raises(ValueError) as cm:
            tdep.gap_model = 'not in the list'

        assert str(cm.value) == \
            "TaskDependency.gap_model should be one of ['length', " \
            "'duration'], not str"
예제 #8
0
    def test_gap_model_attribute_is_not_a_string_instance(self):
        """testing if a TypeError will be raised when the gap_model attribute
        is not a string
        """
        from stalker import TaskDependency
        tdep = TaskDependency(**self.kwargs)
        with pytest.raises(TypeError) as cm:
            tdep.gap_model = 2342

        assert str(cm.value) == \
            "TaskDependency.gap_model should be one of ['length', " \
            "'duration'], not int"