Best Python code snippet using keyboard
test_writers.py
Source:test_writers.py
...89 mock_proxy.scheduler.get_device_status.assert_called_with('%s_01' % self.DEVICE_TYPE)90 mock_proxy.scheduler.submit_job.assert_called_with(self.CONTENT)91 assert_equal(results, ['%s/scheduler/job/%d' % (self.UI_ADDRESS, 42)])92 @mock.patch('xmlrpc.client.ServerProxy')93 def test_write_multiple(self, mock):94 board = {95 'device_type': self.DEVICE_TYPE,96 }97 cfg = {98 'server': 'https://test.example.org/RPC2',99 'username': 'foobar',100 'token': 'deadcoffee42',101 'web_ui_address': self.UI_ADDRESS,102 }103 response = {104 'status': 'online',105 }106 mock_proxy = mock.return_value107 mock_proxy.scheduler.submit_job.return_value = (42, 84)...
test_lh5.py
Source:test_lh5.py
...55 with LH5TrajectoryFile(temp, 'w') as f:56 f.write(coordinates)57 with LH5TrajectoryFile(temp) as f:58 eq(f.read(), coordinates.reshape(1, 10, 3), decimal=3)59def test_write_multiple():60 coordinates = np.random.randn(4, 10, 3)61 with LH5TrajectoryFile(temp, 'w') as f:62 f.write(coordinates)63 f.write(coordinates)64 with LH5TrajectoryFile(temp) as f:65 eq(f.read(), np.vstack((coordinates, coordinates)), decimal=3)66def test_topology(get_fn):67 top = md.load(get_fn('native.pdb')).topology68 with LH5TrajectoryFile(temp, 'w') as f:69 f.topology = top70 with LH5TrajectoryFile(temp) as f:71 assert f.topology == top72def test_read_slice_0():73 coordinates = np.random.randn(4, 10, 3)...
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.
You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.
Get 100 minutes of automation test minutes FREE!!