diff --git a/spatialmedia/metadata_utils.py b/spatialmedia/metadata_utils.py index 35b6532..345d905 100755 --- a/spatialmedia/metadata_utils.py +++ b/spatialmedia/metadata_utils.py @@ -540,7 +540,7 @@ def inject_metadata(src, dest, metadata, console): console("Unknown file type") -def generate_spherical_xml(projection="equiretangular", stereo=None, crop=None): +def generate_spherical_xml(projection="equirectangular", stereo=None, crop=None): # Configure inject xml. additional_xml = "" if stereo == "top-bottom": diff --git a/spatialmedia_test.py b/spatialmedia_test.py index 39fc189..a4673aa 100644 --- a/spatialmedia_test.py +++ b/spatialmedia_test.py @@ -151,6 +151,18 @@ def test_inject_v2_rectangular_top_bottom(self): self.assertTrue(contents.find('Stereo Mode: 1') >= 0) +class TestGenerateSphericalXml(unittest.TestCase): + def test_default_projection_is_equirectangular(self): + """Default projection must match the equirectangular comparison string.""" + xml = metadata_utils.generate_spherical_xml() + self.assertIn('equirectangular', xml) + self.assertIn('true', xml) + + def test_none_projection_is_not_spherical(self): + xml = metadata_utils.generate_spherical_xml(projection='none') + self.assertNotIn('equirectangular', xml) + self.assertIn('false', xml) + if __name__ == '__main__': try: os.mkdir('test_output')