Пример #1
0
    def test_get_time_of_creation_afternoon(self):
        """should return the creation time in the '24H' format"""
        test_channel = Channel("Scenes From a Memory", "Dream Theater")
        test_channel.creation_time = datetime.fromisoformat(
            '2020-02-10 14:30:00.000')

        self.assertEqual(test_channel._get_time_of_creation(), "14:30")
Пример #2
0
    def test_get_time_of_creation_morning(self):
        """should return the creation time in the correct format (no leading 
        zeroes for hours)"""
        test_channel = Channel("Scenes From a Memory", "Dream Theater")
        test_channel.creation_time = datetime.fromisoformat(
            '2013-02-08 09:07:00.000')

        self.assertEqual(test_channel._get_time_of_creation(), "9:07")
Пример #3
0
    def test_get_time_of_creation_midnight(self):
        """should return the creation time with the correct zero formats (one 
        digit for hours, two for minutes) when it was at midnight"""
        test_channel = Channel("Scenes From a Memory", "Dream Theater")
        test_channel.creation_time = datetime.fromisoformat(
            '2013-02-08 00:00:00.000')

        self.assertEqual(test_channel._get_time_of_creation(), "0:00")