Skip to content

Commit

Permalink
Improve coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
richardkiss committed Jan 23, 2024
1 parent 6f56daa commit 2963b7d
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion tests/test_clvm_serde.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from dataclasses import dataclass, field
from typing import List, Tuple, Optional
from typing import List, Optional, Union, Tuple

import random

Expand Down Expand Up @@ -159,6 +159,16 @@ class Foo:
fp = from_program_for_type(Foo)
assert fp(tp(Foo([]))) == Foo([])

@dataclass
class Bar:
a: Union[int, str]

with pytest.raises(ValueError):
_ = to_program_for_type(Bar)

with pytest.raises(ValueError):
_ = from_program_for_type(Bar)


def test_serde_frugal():
@dataclass
Expand Down

0 comments on commit 2963b7d

Please sign in to comment.