Add support for repeated timestamps and durations to to_dict from_dict (#211)
This commit is contained in:
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"times": ["1972-01-01T10:00:20.021Z", "1972-01-01T10:00:20.021Z"],
|
||||
"durations": ["1.200s", "1.200s"]
|
||||
}
|
@@ -0,0 +1,10 @@
|
||||
syntax = "proto3";
|
||||
|
||||
import "google/protobuf/duration.proto";
|
||||
import "google/protobuf/timestamp.proto";
|
||||
|
||||
|
||||
message Test {
|
||||
repeated google.protobuf.Timestamp times = 1;
|
||||
repeated google.protobuf.Duration durations = 2;
|
||||
}
|
@@ -0,0 +1,9 @@
|
||||
from datetime import datetime, timedelta
|
||||
|
||||
from tests.output_betterproto.repeated_duration_timestamp import Test
|
||||
|
||||
|
||||
def test_roundtrip():
|
||||
message = Test()
|
||||
message.times = [datetime.now(), datetime.now()]
|
||||
message.durations = [timedelta(), timedelta()]
|
Reference in New Issue
Block a user