(odb: Odb)
| 69 | |
| 70 | |
| 71 | def test_read(odb: Odb) -> None: |
| 72 | with pytest.raises(TypeError): |
| 73 | odb.read(123) # type: ignore |
| 74 | utils.assertRaisesWithArg(KeyError, '1' * 40, odb.read, '1' * 40) |
| 75 | |
| 76 | ab = odb.read(BLOB_OID) |
| 77 | a = odb.read(BLOB_HEX) |
| 78 | assert ab == a |
| 79 | assert (ObjectType.BLOB, BLOB_CONTENTS) == a |
| 80 | assert isinstance(a[0], ObjectType) |
| 81 | |
| 82 | a2 = odb.read('7f129fd57e31e935c6d60a0c794efe4e6927664b') |
| 83 | assert (ObjectType.BLOB, b'a contents 2\n') == a2 |
| 84 | assert isinstance(a2[0], ObjectType) |
| 85 | |
| 86 | a_hex_prefix = BLOB_HEX[:4] |
| 87 | a3 = odb.read(a_hex_prefix) |
| 88 | assert (ObjectType.BLOB, BLOB_CONTENTS) == a3 |
| 89 | assert isinstance(a3[0], ObjectType) |
| 90 | |
| 91 | |
| 92 | def test_read_header(odb: Odb) -> None: |
nothing calls this directly
no test coverage detected
searching dependent graphs…