How to use _check_properties method in Lemoncheesecake

Best Python code snippet using lemoncheesecake

service.py

Source:service.py Github

copy

Full Screen

...54 def fdel(self):55 del (self._init_type_implementation)56 del (self._init_type_name)57 return locals()58 def _check_properties(self):59 if not hasattr(self, '_init_type_implementation'):60 raise init_exception_init_type("Property 'init_type' has invalid value.")61 def is_running(self, **kwargs):62 """Get the service is_running63 return:64 True for running65 False for not running66 """67 self._check_properties()68 return self._init_type_implementation.is_running(**kwargs)69 def start(self, **kwargs):70 """Start service71 throws exception on failure:72 """73 self._check_properties()74 return self._init_type_implementation.start(**kwargs)75 def stop(self, **kwargs):76 self._check_properties()77 return self._init_type_implementation.stop(**kwargs)78 def restart(self, **kwargs):79 self._check_properties()80 return self._init_type_implementation.restart(**kwargs)81 def on_boot_enable(self, **kwargs):82 self._check_properties()83 return self._init_type_implementation.on_boot_enable(**kwargs)84 def on_boot_disable(self, **kwargs):85 self._check_properties()86 return self._init_type_implementation.on_boot_disable(**kwargs)87class init_system_systemd():88 def _get_systemctl_name(self, **kwargs):89 service = kwargs.get("service")90 if service == None:91 raise92 identifier = kwargs.get("identifier")93 if identifier != None:94 return str(service + "@" + identifier)95 return service96 def is_running(self, **kwargs):97 systemctl_name = self._get_systemctl_name(**kwargs)98 arguments = [99 util_which.which_systemctl.path,...

Full Screen

Full Screen

test_interfaces.py

Source:test_interfaces.py Github

copy

Full Screen

...28 def setUpClass(cls):29 """Initialize implementation"""30 super(BaseInterfaceTestCase, cls).setUpClass()31 cls._instance = cls.implementation_class()32 def _check_properties(self):33 """Check that all properties are abstract"""34 for prop_name in self.properties:35 with self.assertRaises(NotImplementedError):36 getattr(self._instance, prop_name)37class CommandInterfaceTestCase(BaseInterfaceTestCase):38 """Test case for Command interface"""39 implementation_class = interfaces.FakeCommand40 properties = ('output', 'arguments', 'command', 'return_code', 'errors')41 def test_command_interface(self):42 self._check_properties()43class TerminalInterfaceTestCase(BaseInterfaceTestCase):44 """Test case for Terminal integration interface"""45 implementation_class = interfaces.FakeTerminal46 properties = ('available_commands', 'shell_name')47 def test_terminal_integration_interface(self):48 self._check_properties()49class ProcessInterfaceTestCase(BaseInterfaceTestCase):50 """Test case for Process interface"""51 implementation_class = interfaces.FakeProcess52 properties = ('stderr', 'stdout', 'returncode', 'is_finished',53 'is_undefined')54 def test_process_interface(self):55 self._check_properties()56 with self.assertRaises(NotImplementedError):...

Full Screen

Full Screen

__init__.py

Source:__init__.py Github

copy

Full Screen

...18 if not issubclass(cls, ObservatoryProperties):19 raise ValueError('Illegal properties value.')20 ObservatoryProperties._properties = cls()21 @staticmethod22 def _check_properties() -> NoReturn:23 if ObservatoryProperties._properties is None:24 raise ValueError('Properties have not been set.')25 @staticmethod26 def determine_standard_time(resources: FrozenSet,27 wavelengths: FrozenSet[float],28 modes: FrozenSet,29 cal_length: int) -> Time:30 """31 Given the information, determine the length in hours required for calibration32 on a standard star.33 TODO: Is this the correct description?34 TODO: Do we need modes here or can these just be determined from resources?35 TODO: Based on the Gemini code, it seems like the latter is the case, but we do have36 TODO: the obsmode code in the atom extraction which provides an ObservationMode.37 """38 ObservatoryProperties._check_properties()39 return ObservatoryProperties._properties.determine_standard_time(40 resources,41 wavelengths,42 modes,43 cal_length44 )45 @staticmethod46 def is_instrument(resource) -> bool:47 """48 Determine if the given resource is an instrument or not.49 """50 ObservatoryProperties._check_properties()51 return ObservatoryProperties._properties.is_instrument(resource)52 @staticmethod53 def acquisition_time(resource, observation_mode) -> Optional[timedelta]:54 """55 Given a resource, check if it is an instrument, and if so, lookup the56 acquisition time for the specified mode.57 """58 ObservatoryProperties._check_properties()...

Full Screen

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run Lemoncheesecake automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful