def test_format_data_with_unjsonable_dict(self): class A: pass data = {'a': 'something', 'b': A()} expected = str(data) self.assertEqual(CaseLogger._format_data(data), expected)
def test_format_data_with_string(self): string = 'something' self.assertEqual(CaseLogger._format_data(string), string)
def test_format_data_with_jsonable_dict(self): data = {'a': 'something', 'b': 5} expected = json.dumps(data) self.assertEqual(CaseLogger._format_data(data), expected)
def test_format_data_with_none(self): self.assertEqual(CaseLogger._format_data(None), '')