Exemple #1
0
 def test_get_attr(self):
     """Test the __getattr__ method"""
     metadata_dict = {
         "superTitle": "Dummy Title",
     }
     metadata = data_structures.MetadataDictBase(metadata_dict)
     # Test normal lookup
     assert metadata.super_title == "Dummy Title"
     # Test raise attribute error when the key is not in metadata
     with pytest.raises(AttributeError):
         metadata.nonexistent_key
Exemple #2
0
    def test_init(self):
        """Test normal __init__ functionality; metadata stored and camel case
        names coverted

        """
        metadata_dict = {
            "superTitle": "Dummy Title",
        }
        metadata = data_structures.MetadataDictBase(metadata_dict)
        # Assert only metadata element, name conversion and value
        assert len(metadata.metadata) == 1
        assert metadata.super_title == "Dummy Title"