Beispiel #1
0
    def test_is_invalid(self):
        valid_heso = self._make_heso()
        self.assertFalse(application.is_invalid(valid_heso))

        desc_blank_heso = valid_heso.copy()
        desc_blank_heso['description'] = ""
        self.assertTrue(application.is_invalid(desc_blank_heso))

        fname_blank_heso = valid_heso.copy()
        fname_blank_heso['files'][0]['filename'] = ""
        self.assertTrue(application.is_invalid(fname_blank_heso))
Beispiel #2
0
    def test_is_invalid(self):
        valid_heso = {'description': "This is description.",
                      'files': [{'filename': "heso_test.py",
                                'document': "import heso"}]}
        self.assertFalse(application.is_invalid(valid_heso))

        invalid_heso = {'description': "",
                      'files':[{'filename': "heso_test.py",
                                'document': "import heso"}]}
        self.assertTrue(application.is_invalid(invalid_heso))

        invalid_heso = {'description': "This is description.",
                      'files':[{'filename': "",
                                'document': "import heso"}]}
        self.assertTrue(application.is_invalid(invalid_heso))