Example #1
0
 def test_links_attribute_is_set_to_none(self):
     """testing if a TypeError will be raised when the links attribute is
     set to None
     """
     daily = Daily(name='Test Daily', project=self.test_project)
     with self.assertRaises(TypeError):
         daily.links = None
Example #2
0
 def test_links_attribute_is_set_to_none(self):
     """testing if a TypeError will be raised when the links attribute is
     set to None
     """
     daily = Daily(name='Test Daily', project=self.test_project)
     with self.assertRaises(TypeError):
         daily.links = None
Example #3
0
 def test_tasks_attribute_will_return_a_list_of_tasks(self):
     """testing if the tasks attribute is a list of Task instances related
     to the given links
     """
     daily = Daily(name='Test Daily', project=self.test_project)
     daily.links = [self.test_link1, self.test_link2]
     db.DBSession.add(daily)
     db.DBSession.commit()
     self.assertEqual(daily.tasks, [self.test_task1])
Example #4
0
 def test_tasks_attribute_will_return_a_list_of_tasks(self):
     """testing if the tasks attribute is a list of Task instances related
     to the given links
     """
     daily = Daily(name='Test Daily', project=self.test_project)
     daily.links = [self.test_link1, self.test_link2]
     db.DBSession.add(daily)
     db.DBSession.commit()
     self.assertEqual(daily.tasks, [self.test_task1])
Example #5
0
 def test_links_attribute_is_set_to_none(self):
     """testing if a TypeError will be raised when the links attribute is
     set to None
     """
     from stalker import Daily
     daily = Daily(name='Test Daily',
                   project=self.test_project,
                   status_list=self.daily_status_list)
     with pytest.raises(TypeError):
         daily.links = None
Example #6
0
 def test_versions_attribute_will_return_a_list_of_versions(self):
     """testing if the versions attribute is a list of Version instances
     related to the given links
     """
     from stalker import db, Daily
     daily = Daily(name='Test Daily', project=self.test_project)
     daily.links = [self.test_link1, self.test_link2]
     db.DBSession.add(daily)
     db.DBSession.commit()
     self.assertEqual(daily.versions, [self.test_version1])
Example #7
0
 def test_versions_attribute_will_return_a_list_of_versions(self):
     """testing if the versions attribute is a list of Version instances
     related to the given links
     """
     from stalker import Daily
     daily = Daily(name='Test Daily',
                   project=self.test_project,
                   status_list=self.daily_status_list)
     daily.links = [self.test_link1, self.test_link2]
     from stalker.db.session import DBSession
     DBSession.add(daily)
     DBSession.commit()
     assert daily.versions == [self.test_version1]