Skip to content

Commit

Permalink
Fix linter warnings
Browse files Browse the repository at this point in the history
Signed-off-by: Jean-Christophe Morin <[email protected]>
  • Loading branch information
JeanChristopheMorinPerso committed Mar 9, 2024
1 parent cf764ee commit 413f418
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 24 deletions.
10 changes: 5 additions & 5 deletions src/py-opentimelineio/opentimelineio/core/_core_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,7 @@ def __copy__(self, *args, **kwargs):


@add_method(AnyDictionary)
def to_dict(self):
def to_dict(self): # noqa: F811
"""
Convert to a built-in dict. It will recursively convert all values
to their corresponding python built-in types.
Expand All @@ -415,7 +415,7 @@ def to_list(self):


@add_method(SerializableObject)
def to_dict(self):
def to_dict(self): # noqa: F811
"""
Convert to a built-in dict. It will recursively convert all values
to their corresponding python built-in types.
Expand All @@ -424,7 +424,7 @@ def to_dict(self):


@add_method(RationalTime)
def to_dict(self):
def to_dict(self): # noqa: F811
"""
Convert to a built-in dict. It will recursively convert all values
to their corresponding python built-in types.
Expand All @@ -433,7 +433,7 @@ def to_dict(self):


@add_method(TimeRange)
def to_dict(self):
def to_dict(self): # noqa: F811
"""
Convert to a built-in dict. It will recursively convert all values
to their corresponding python built-in types.
Expand All @@ -442,7 +442,7 @@ def to_dict(self):


@add_method(TimeTransform)
def to_dict(self):
def to_dict(self): # noqa: F811
"""
Convert to a built-in dict. It will recursively convert all values
to their corresponding python built-in types.
Expand Down
38 changes: 19 additions & 19 deletions tests/test_core_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -252,45 +252,45 @@ def test_SerializableObject(self):
so = opentimelineio.core.SerializableObjectWithMetadata(name="asd")
so.metadata["key1"] = opentimelineio.core.Composition()

d = so.to_dict()
self.assertTrue(isinstance(d, dict))
json.dumps(d)
converted = so.to_dict()
self.assertTrue(isinstance(converted, dict))
json.dumps(converted)

def test_AnyDictionary(self):
ad = opentimelineio._otio.AnyDictionary()
ad["my key"] = opentimelineio.core.Composable()

d = ad.to_dict()
self.assertTrue(isinstance(d, dict))
json.dumps(d)
converted = ad.to_dict()
self.assertTrue(isinstance(converted, dict))
json.dumps(converted)

def test_AnyVector(self):
av = opentimelineio._otio.AnyVector()
av.append(1)
av.append(opentimelineio._otio.AnyDictionary())

l = av.to_list()
self.assertTrue(isinstance(l, list))
self.assertEqual(l, [1, {}])
json.dumps(l)
converted = av.to_list()
self.assertTrue(isinstance(converted, list))
self.assertEqual(converted, [1, {}])
json.dumps(converted)

def test_RationalTime(self):
rt = opentimelineio.opentime.RationalTime()

d = rt.to_dict()
self.assertTrue(isinstance(d, dict))
json.dumps(d)
converted = rt.to_dict()
self.assertTrue(isinstance(converted, dict))
json.dumps(converted)

def test_TimeRange(self):
tr = opentimelineio.opentime.TimeRange()

d = tr.to_dict()
self.assertTrue(isinstance(d, dict))
json.dumps(d)
converted = tr.to_dict()
self.assertTrue(isinstance(converted, dict))
json.dumps(converted)

def test_TimeTransform(self):
tt = opentimelineio.opentime.TimeTransform()

d = tt.to_dict()
self.assertTrue(isinstance(d, dict))
json.dumps(d)
converted = tt.to_dict()
self.assertTrue(isinstance(converted, dict))
json.dumps(converted)

0 comments on commit 413f418

Please sign in to comment.