Beispiel #1
0
    def test_parser_returns_expected_on_valid_metadata(self):
        mock_gen = [[
            'GROUP = TEST1', 'ATTR1 = 1', 'ATTR2 = 2.0', 'ATTR3 = "A TEST"'
        ]]
        fields = ('GROUP', 'ATTR1', 'ATTR2', 'ATTR3')

        result = LandsatMetadata.parser(mock_gen)
        for item in result:
            self.assertTrue(item, tuple)
            self.assertEqual(fields, item._fields)
Beispiel #2
0
    def test_parser_fails_on_invalid_metadata(self):
        mock_gen = [['GROUP = TEST1'], ['FOO', 'BAR'], []]

        with self.assertRaises(ParsingError):
            LandsatMetadata.parser(mock_gen)