Exemplo n.º 1
0
 def test_error_mo_encoding(self):
     """Fail to parse a MetaData object."""
     hit_exception = False
     try:
         metadata_encode(MetaData([complex('1+2j')]))
     except TypeError:
         hit_exception = True
     self.assertTrue(hit_exception)
Exemplo n.º 2
0
 def test_encoding_plus_extras(self):
     """Test the metadata encoding with simple example."""
     md_obj = MetaData([MetaObj(destinationTable='blarg'), {'foo': 'bar'}])
     hit_exception = False
     try:
         metadata_encode(md_obj)
     except TypeError:
         hit_exception = True
     self.assertTrue(hit_exception)
Exemplo n.º 3
0
 def test_encoding_with_files(self):
     """Test the metadata encoding with simple example."""
     md_obj = MetaData([FileObj(destinationTable='Files')])
     meta_str = metadata_encode(md_obj)
     self.assertTrue(meta_str == '[{"destinationTable": "Files"}]')
Exemplo n.º 4
0
 def test_encoding(self):
     """Test the metadata encoding with simple example."""
     md_obj = MetaData([MetaObj(destinationTable='blarg')])
     meta_str = metadata_encode(md_obj)
     self.assertTrue(meta_str == '[{"destinationTable": "blarg"}]')