def test_6_errorMetadata(self): ''' test all in error ''' for lid in _testvals('ipn'): try: meta = self.vdtr.metadata(lid) runChecks(meta, lid) except MetadataErrorException as mee: self.assertIsInstance(mee, MetadataErrorException) continue self.asserFalse(True, 'Expected MetadataErrorException')
def test_5_noneMetadata(self): ''' test error check on layers with missing fields ''' for lid in _testvals('n'): try: meta = self.vdtr.metadata(lid) runChecks(meta, lid) except MetadataNoneException as mne: self.assertIsInstance(mne, MetadataNoneException) continue self.assertFalse(True, 'Expected MetadataNoneException')
def test_4_emptyMetadata(self): ''' test error check on layers with empty tags ''' for lid in _testvals('e'): try: meta = self.vdtr.metadata(lid) runChecks(meta, lid) except MetadataEmptyException as mee: self.assertIsInstance(mee, MetadataEmptyException) continue self.assertFalse(True, 'Expected MetadataEmptyException')
def test_3_incorrectMetadata(self): ''' test error check on incorrect/invalid layers ''' for lid in _testvals('i'): try: meta = self.vdtr.metadata(lid) runChecks(meta, lid) except MetadataIncorrectException as mie: self.assertIsInstance(mie, MetadataIncorrectException) continue self.assertFalse(True, 'Expected MetadataIncorrectException')
def test_2_correctAllMetadata(self): ''' test error check on correct layers ''' try: print(os.getcwd()) metafile = r'{}/testAllCorrect.xml'.format(os.getcwd()) con = r'{}/testConfigAll.yaml'.format(os.getcwd()) meta = self.vdtr.metadata(name=metafile) runChecks(meta, con=con) except Exception as e: self.assertFalse(True)
def test_8_invalidConfig(self): '''test config with invalid config option ''' for lid in _testvals('c'): try: meta = self.vdtr.metadata(lid) file = r'{}/testConfigInvalid.yaml'.format(os.getcwd()) runChecks(meta, lid=lid, con=file) except InvalidConfigException as ie: self.assertIsInstance(ie, InvalidConfigException) continue self.assertFalse(True, 'Expected InvalidConfigException')
def test_7_allOptionsConfig(self): ''' test config with all options at least True All 'correct' should show as None, as none have facsimile for metadata contact. ''' for lid in _testvals('c'): try: meta = self.vdtr.metadata(lid) file = r'{}/testConfigAll.yaml'.format(os.getcwd()) runChecks(meta, lid=lid, con=file) except MetadataNoneException as mne: self.assertIsInstance(mne, MetadataNoneException) continue self.assertFalse(True, 'Expected MetadataNoneException')