Example #1
0
 def test_json_options(self):
     structure = {
         "name": 1,
         "options": '{"test": 1}'
     }
     res = flatten(structure)
     self.assertTrue("name" in res)
     self.assertTrue("test" in res)
     self.assertTrue("options" not in res)
Example #2
0
 def test_non_dict(self):
     structure = "test"
     self.assertEqual(flatten(structure), "test")
Example #3
0
 def test_dict_options(self):
     structure = {"name": 1, "options": {"test": 1}}
     res = flatten(structure)
     self.assertTrue("name" in res)
     self.assertTrue("test" in res)
     self.assertTrue("options" not in res)
Example #4
0
 def test_dict_with_no_options(self):
     structure = {"name": 1}
     self.assertEqual(flatten(structure), structure)
Example #5
0
 def test_dict_with_no_options(self):
     structure = {"name": 1}
     self.assertEqual(flatten(structure), structure)
Example #6
0
 def test_non_dict(self):
     structure = "test"
     self.assertEqual(flatten(structure), "test")