~launchpad-committers/storm/lp

« back to all changes in this revision

Viewing changes to storm/tests/properties.py

  • Committer: Colin Watson
  • Date: 2023-07-06 10:51:34 UTC
  • mfrom: (386.34.138 storm)
  • Revision ID: cjwatson@canonical.com-20230706105134-rzpb4opv8nfpg56r
Merge Storm 0.26 release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
846
846
            self.assertRaises(NoneError, variable.set, None)
847
847
            self.assertEqual(variable.get(), value)
848
848
 
 
849
            # Test default=None and allow_none=False (incoherent).
 
850
            Class.prop = func(name="name", default=None, allow_none=False)
 
851
            column = Class.prop.__get__(None, Class)
 
852
            self.assertEqual(column.name, "name")
 
853
            self.assertEqual(column.table, Class)
 
854
 
 
855
            self.assertRaises(NoneError, column.variable_factory)
 
856
 
849
857
            # Test default_factory.
850
858
            Class.prop = func(name="name", default_factory=lambda:value)
851
859
            column = Class.prop.__get__(None, Class)