예제 #1
0
    def test_song_validate_argument_raises_exception_if_argument_type_not_str(
            self):
        test = 5
        exc = None

        try:
            Song.validate_argument(test)
        except Exception as err:
            exc = err

        self.assertIsNotNone(exc)
        self.assertEqual(str(exc), 'All arguments must be of "str" type.')
예제 #2
0
    def test_song_validate_argument_raises_exception_if_argument_is_empty_string(
            self):
        test = ''
        exc = None

        try:
            Song.validate_argument(test)
        except Exception as err:
            exc = err

        self.assertIsNotNone(exc)
        self.assertEqual(str(exc), 'Empty string cannot be an argument.')
예제 #3
0
    def test_song_validate_argument_passes_with_correct_input(self):
        test = 'Test'

        Song.validate_argument(test)