mirror of
https://github.com/gradio-app/gradio.git
synced 2024-12-15 02:11:15 +08:00
fix tests
This commit is contained in:
parent
859426bb78
commit
882bd9176e
@ -71,7 +71,8 @@ class TestLabel(unittest.TestCase):
|
||||
with tempfile.TemporaryDirectory() as tmpdir:
|
||||
to_save = label_output.save_flagged(tmpdir, "label_output", label, None)
|
||||
self.assertEqual(to_save, '{"3": 0.7, "1": 0.2}')
|
||||
self.assertEqual(label_output.restore_flagged(tmpdir, to_save, None), {"3": 0.7, "1": 0.2})
|
||||
self.assertEqual(label_output.restore_flagged(tmpdir, to_save, None),
|
||||
{'label': '3', 'confidences': [{"label": "3", "confidence": 0.7}, {"label": "1", "confidence": 0.2}]})
|
||||
with self.assertRaises(ValueError):
|
||||
label_output = gr.outputs.Label(type="unknown")
|
||||
label_output.deserialize([1, 2, 3])
|
||||
|
Loading…
Reference in New Issue
Block a user