BioImager  3.9.1
A .NET microscopy imaging library. Supports various microscopes by using imported libraries & GUI automation. Supported libraries include PriorĀ® & ZeissĀ® & all devices supported by Micromanager 2.0 and python-microscope.
Loading...
Searching...
No Matches
microscope.testsuite.test_settings.TestEnumSetting Class Reference
Inheritance diagram for microscope.testsuite.test_settings.TestEnumSetting:

Public Member Functions

def test_get_returns_enum_value (self)
 
def test_set_creates_enum (self)
 
def test_set_and_get_write_only (self)
 

Detailed Description

Definition at line 58 of file test_settings.py.

Member Function Documentation

◆ test_get_returns_enum_value()

def microscope.testsuite.test_settings.TestEnumSetting.test_get_returns_enum_value (   self)
For enums, get() returns the enum value not the enum instance

Definition at line 59 of file test_settings.py.

59 def test_get_returns_enum_value(self):
60 """For enums, get() returns the enum value not the enum instance"""
61 setting, thing = create_enum_setting(1)
62 self.assertIsInstance(setting.get(), int)
63

◆ test_set_and_get_write_only()

def microscope.testsuite.test_settings.TestEnumSetting.test_set_and_get_write_only (   self)
get() works for write-only enum settings

Definition at line 71 of file test_settings.py.

71 def test_set_and_get_write_only(self):
72 """get() works for write-only enum settings"""
73 setting, thing = create_enum_setting(1, with_getter=False)
74 self.assertEqual(EnumSetting(1), thing.val)
75 setting.set(2)
76 self.assertEqual(setting.get(), 2)
77 self.assertEqual(EnumSetting(2), thing.val)
78
79

◆ test_set_creates_enum()

def microscope.testsuite.test_settings.TestEnumSetting.test_set_creates_enum (   self)
For enums, set() sets an enum instance, not the enum value

Definition at line 64 of file test_settings.py.

64 def test_set_creates_enum(self):
65 """For enums, set() sets an enum instance, not the enum value"""
66 setting, thing = create_enum_setting(1)
67 setting.set(2)
68 self.assertIsInstance(thing.val, EnumSetting)
69 self.assertEqual(thing.val, EnumSetting(2))
70

The documentation for this class was generated from the following file: