Ejemplo n.º 1
0
 def test_dumper_can_dump_decimals(self):
     doc = {
         "format": "Dashboard Bundle Format 1.0",
         "test_runs": [
             {
                 "test_id": "NOT RELEVANT",
                 "analyzer_assigned_date": "2010-11-14T01:03:06Z",
                 "analyzer_assigned_uuid": "NOT RELEVANT",
                 "time_check_performed": False,
                 "test_results": [
                     {
                         "test_case_id": "NOT RELEVANT",
                         "result": "unknown",
                         "measurement": Decimal("1.5")}]}]}
     text = JSON.dumps(doc)
     self.assertIn("1.5", text)
Ejemplo n.º 2
0
 def test_dumper_can_dump_decimals(self):
     doc = {
         "format":
         "Dashboard Bundle Format 1.0",
         "test_runs": [{
             "test_id":
             "NOT RELEVANT",
             "analyzer_assigned_date":
             "2010-11-14T01:03:06Z",
             "analyzer_assigned_uuid":
             "NOT RELEVANT",
             "time_check_performed":
             False,
             "test_results": [{
                 "test_case_id": "NOT RELEVANT",
                 "result": "unknown",
                 "measurement": Decimal("1.5")
             }]
         }]
     }
     text = JSON.dumps(doc)
     self.assertIn("1.5", text)
Ejemplo n.º 3
0
 def test_dumps_produces_compact_sorted_ouptut(self):
     observed_text = JSON.dumps(
         self.doc, human_readable=False, sort_keys=True)
     self.assertEqual(observed_text, self.expected_compact_sorted_text)
Ejemplo n.º 4
0
 def test_dumps_produces_readable_ouptut(self):
     observed_text = JSON.dumps(self.doc, human_readable=True)
     self.assertEqual(observed_text, self.expected_readable_text)
Ejemplo n.º 5
0
 def test_dumps_produces_compact_sorted_ouptut(self):
     observed_text = JSON.dumps(self.doc,
                                human_readable=False,
                                sort_keys=True)
     self.assertEqual(observed_text, self.expected_compact_sorted_text)
Ejemplo n.º 6
0
 def test_dumps_produces_readable_ouptut(self):
     observed_text = JSON.dumps(self.doc, human_readable=True)
     self.assertEqual(observed_text, self.expected_readable_text)