def test_name_not_empty(self):
        """ test that name field is not empty """

        data = {
            "audiotype": "Song",
            "metadata":
            {
                "duration": 37477,
                "name": "my book",
            }
        }
        result = Validation.validateSong(data)
        result = result["data"]["metadata"]
        self.assertTrue(result["name"])
    def test_duration_is_number(self):
        """ test that duration in number type """

        data = {
            "audiotype": "Song",
            "metadata":
            {
                "duration": 37477,
                "name": "my book",
            }
        }
        result = Validation.validateSong(data)
        result = result["data"]["metadata"]
        self.assertEqual(type(result["duration"]), type(0.0))
    def test_name_not_empty(self):
        """ test that name field is not empty """

        data = {
            "audiotype": "Podcast",
            "metadata": {
                "duration": 37477,
                "name": "small world",
                "host": "Solomon",
                "participants": ["lee", "Daniel", "lukeng"]
            }
        }
        result = Validation.validatePodcast(data)
        result = result["data"]["metadata"]
        self.assertTrue(result["name"])
    def test_duration_is_number(self):
        """ test that duration in number type """

        data = {
            "audiotype": "Podcast",
            "metadata": {
                "duration": 37477,
                "name": "small world",
                "host": "Solomon",
                "participants": ["lee", "Daniel", "lukeng"]
            }
        }
        result = Validation.validatePodcast(data)
        result = result["data"]["metadata"]
        self.assertEqual(type(result["duration"]), type(0.0))
Beispiel #5
0
    def test_title_not_empty(self):
        """ test that name field is not empty """

        data = {
            "audiotype": "Audiobook",
            "metadata": {
                "duration": 37477,
                "title": "another",
                "author": "Solomon",
                "narrator": "Ndiferke"
            }
        }
        result = Validation.validateAudiobook(data)
        result = result["data"]["metadata"]
        self.assertTrue(result["title"])
Beispiel #6
0
    def test_duration_is_number(self):
        """ test that duration in number type """

        data = {
            "audiotype": "Audiobook",
            "metadata": {
                "duration": 37477,
                "title": "another",
                "author": "Solomon",
                "narrator": "Ndiferke"
            }
        }
        result = Validation.validateAudiobook(data)
        result = result["data"]["metadata"]
        self.assertEqual(type(result["duration"]), type(0.0))