Best Python code snippet using autotest_python
database_unittest.py
Source:database_unittest.py
...63 (database.tempfile.mkstemp.expect_call(prefix=self._path, dir='')64 .and_return((4, 'tmpfile')))65 database.os.fdopen.expect_call(4, 'wb').and_return(self._file_instance)66 return db, new_files, all_files67 def test_merge_dictionary(self):68 db, new_files, all_files = self._setup_merge_dictionary()69 database.cPickle.dump.expect_call(all_files, self._file_instance,70 protocol=database.cPickle.HIGHEST_PROTOCOL)71 self._file_instance.close.expect_call()72 database.os.rename.expect_call('tmpfile', self._path)73 database.os.close.expect_call(3)74 # playback75 db.merge_dictionary(new_files)76 self.god.check_playback()77 def test_merge_dictionary_disk_full(self):78 err = Exception('fail')79 db, new_files, all_files = self._setup_merge_dictionary()80 database.cPickle.dump.expect_call(all_files, self._file_instance,81 protocol=database.cPickle.HIGHEST_PROTOCOL).and_raises(err)...
test_lib_payload_utils.py
Source:test_lib_payload_utils.py
...43 assert file.get_mime() == payload[ns.MIME]44 assert file.get_filename() == payload[ns.FILENAME]45 assert file.get_size() == payload[ns.SIZE]46 assert file.get_token() == payload[ns.TOKEN]47def test_merge_dictionary():48 from kusanagi.sdk.lib.payload.utils import merge_dictionary49 src = {50 '1': 1,51 '2': [1],52 '3': {'a': 1},53 '4': {'a': {'b': 2}},54 '5': {'a': {'b': [2]}},55 '6': {},56 '7': [],57 }58 dst = {59 '2': [3],60 '3': {'c': 3},61 '4': {'a': {'c': 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!!