| 1 |
#!/usr/bin/env python |
| 2 |
|
| 3 |
# Copyright New York University and the in-toto contributors |
| 4 |
# SPDX-License-Identifier: Apache-2.0 |
| 5 |
|
| 6 |
""" |
| 7 |
<Program Name> |
| 8 |
test_common.py |
| 9 |
|
| 10 |
<Author> |
| 11 |
Santiago Torres-Arias <[email protected]> |
| 12 |
|
| 13 |
<Started> |
| 14 |
Sept 26, 2017 |
| 15 |
|
| 16 |
<Copyright> |
| 17 |
See LICENSE for licensing information. |
| 18 |
|
| 19 |
<Purpose> |
| 20 |
Test the Signable and ValidationMixin class functions. |
| 21 |
|
| 22 |
""" |
| 23 |
|
| 24 |
import json |
| 25 |
import unittest |
| 26 |
|
| 27 |
from in_toto.models.common import Signable |
| 28 |
|
| 29 |
|
| 30 |
class TestSignable(unittest.TestCase): |
| 31 |
"""Verifies Signable class.""" |
| 32 |
|
| 33 |
def test_load_repr_string_as_json(self): |
| 34 |
"""Test load string returned by `Signable.repr` as JSON""" |
| 35 |
json.loads(repr(Signable())) |
| 36 |
|
| 37 |
|
| 38 |
if __name__ == "__main__": |
| 39 |
unittest.main() |