Skip to content

Commit

Permalink
run precommit
Browse files Browse the repository at this point in the history
  • Loading branch information
jensens committed Jun 13, 2024
1 parent 55152a3 commit 8ffb8a7
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions plone/dexterity/tests/test_schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,18 +57,20 @@ def test_default_schema_with_mtime(self):

# Mock schema model
class IDummy(Interface):
dummy = zope.schema.TextLine(title=u"Dummy")
dummy = zope.schema.TextLine(title="Dummy")

mock_model = Model({u"": IDummy})
mock_model = Model({"": IDummy})

# Mock FTI
fti_mock = Mock(spec=DexterityFTI)
fti_mock.lookupModel = Mock(return_value=mock_model)
fti_mock._p_mtime = 1650380190.961898
self.mock_utility(fti_mock, IDexterityFTI, u"testtype")
self.mock_utility(fti_mock, IDexterityFTI, "testtype")

factory = schema.SchemaModuleFactory()
schemaName = schema.portalTypeToSchemaName("testtype", prefix="site", suffix=get_suffix(fti_mock))
schemaName = schema.portalTypeToSchemaName(
"testtype", prefix="site", suffix=get_suffix(fti_mock)
)
klass = factory(schemaName, schema.generated)

self.assertTrue(isinstance(klass, InterfaceClass))
Expand All @@ -82,18 +84,20 @@ def test_default_schema_with_mtime_no_millis(self):

# Mock schema model
class IDummy(Interface):
dummy = zope.schema.TextLine(title=u"Dummy")
dummy = zope.schema.TextLine(title="Dummy")

mock_model = Model({u"": IDummy})
mock_model = Model({"": IDummy})

# Mock FTI
fti_mock = Mock(spec=DexterityFTI)
fti_mock.lookupModel = Mock(return_value=mock_model)
fti_mock._p_mtime = 1650380190.0
self.mock_utility(fti_mock, IDexterityFTI, u"testtype")
self.mock_utility(fti_mock, IDexterityFTI, "testtype")

factory = schema.SchemaModuleFactory()
schemaName = schema.portalTypeToSchemaName("testtype", prefix="site", suffix=get_suffix(fti_mock))
schemaName = schema.portalTypeToSchemaName(
"testtype", prefix="site", suffix=get_suffix(fti_mock)
)
klass = factory(schemaName, schema.generated)

self.assertTrue(isinstance(klass, InterfaceClass))
Expand Down

0 comments on commit 8ffb8a7

Please sign in to comment.