Skip to content

Commit 2a7da2b

Browse files
committed
Add tests for xml_normalize
1 parent 249f4fb commit 2a7da2b

File tree

1 file changed

+43
-0
lines changed

1 file changed

+43
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
#!/usr/bin/env python
2+
# -*- coding: utf-8 -*-
3+
4+
# This work was created by participants in the DataONE project, and is
5+
# jointly copyrighted by participating institutions in DataONE. For
6+
# more information on DataONE, see our web site at http://dataone.org.
7+
#
8+
# Copyright 2009-2016 DataONE
9+
#
10+
# Licensed under the Apache License, Version 2.0 (the "License");
11+
# you may not use this file except in compliance with the License.
12+
# You may obtain a copy of the License at
13+
#
14+
# http://www.apache.org/licenses/LICENSE-2.0
15+
#
16+
# Unless required by applicable law or agreed to in writing, software
17+
# distributed under the License is distributed on an "AS IS" BASIS,
18+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19+
# See the License for the specific language governing permissions and
20+
# limitations under the License.
21+
import pytest
22+
23+
import d1_test.d1_test_case
24+
import d1_test.xml_normalize
25+
26+
27+
class TestXmlNormalize(d1_test.d1_test_case.D1TestCase):
28+
@pytest.mark.parametrize(
29+
"xml_testfile",
30+
[
31+
'xml_normalize_1.xml',
32+
'xml_normalize_2.xml',
33+
'systemMetadata_v2_0.swizzled.xml',
34+
'node_list_gmn_valid_swizzled.xml',
35+
],
36+
)
37+
def test_0010(self, xml_testfile):
38+
xml = self.test_files.load_xml_to_str(xml_testfile)
39+
norm_str = d1_test.xml_normalize.get_normalized_xml_representation(xml)
40+
# self.sample.gui_sxs_diff(xml, norm_str)
41+
self.sample.assert_equals(
42+
norm_str, xml_testfile
43+
)

0 commit comments

Comments
 (0)