Пример #1
0
 def test__check_if_creation_time_is_valid_with_invalid_input_a_day_later(self):
     """should throw an exception when creation time is later than the 
     current system time
     """
     test_channel = Channel("Kerekes", "Tanyasi Jóska")
     test_channel.creation_time = datetime.now() + timedelta(1)
     
     with self.assertRaises(ValueError): 
         test_channel._check_if_creation_time_is_valid()
Пример #2
0
    def test__check_if_creation_time_is_valid_with_valid_input(self):
        """should NOT throw an exception when creation time is earlier than the
        current system time
        """
        test_channel = Channel("Kerekes", "Tanyasi Jóska")

        try:
            test_channel._check_if_creation_time_is_valid()
        except:
            raised = True
    
            self.assertFalse(raised, 'Exception raised')