Best Python code snippet using localstack_python
test_request.py
Source: test_request.py
...82 assert request.content_length == 783def test_get_custom_headers():84 request = Request("GET", "/", body="foobar", headers={"x-amz-target": "foobar"})85 assert request.headers["x-amz-target"] == "foobar"86def test_get_raw_path():87 request = Request("GET", "/foo/bar/ed", raw_path="/foo%2Fbar/ed")88 assert request.path == "/foo/bar/ed"89 assert request.environ["RAW_URI"] == "/foo%2Fbar/ed"90 assert get_raw_path(request) == "/foo%2Fbar/ed"91def test_get_raw_path_with_query():92 request = Request("GET", "/foo/bar/ed", raw_path="/foo%2Fbar/ed?fizz=buzz")93 assert request.path == "/foo/bar/ed"94 assert request.environ["RAW_URI"] == "/foo%2Fbar/ed?fizz=buzz"95 assert get_raw_path(request) == "/foo%2Fbar/ed"96def test_headers_retain_dashes():97 request = Request("GET", "/foo/bar/ed", {"X-Amz-Meta--foo_bar-ed": "foobar"})98 assert "x-amz-meta--foo_bar-ed" in request.headers99 assert request.headers["x-amz-meta--foo_bar-ed"] == "foobar"100def test_headers_retain_case():...
test_config.py
Source: test_config.py
...31 def test_get_password(self):32 self.config_parser.get.return_value = '<password>'33 assert_that(self.config.get_password()).is_equal_to('<password>')34 assert_that(self.config_parser.mock_calls).contains(call.get('auth', 'password'))35 def test_get_raw_path(self):36 self.config_parser.get.return_value = '<raw_path>'37 assert_that(self.config.get_raw_path()).is_equal_to('<raw_path>')38 assert_that(self.config_parser.mock_calls).contains(call.get('path', 'raw'))39 def test_get_archive_path(self):40 self.config_parser.get.return_value = '<archive_path>'41 assert_that(self.config.get_archive_path()).is_equal_to('<archive_path>')42 assert_that(self.config_parser.mock_calls).contains(call.get('path', 'archive'))43 def test_get_db_connection_string(self):44 self.config_parser.get.side_effect = lambda *x: {45 ('db', 'host'): '<host>',46 ('db', 'dbname'): '<dbname>',47 ('db', 'username'): '<username>',48 ('db', 'password'): '<password>'}[x]49 assert_that(self.config.get_db_connection_string()) \...
test_data_path.py
Source: test_data_path.py
...4SUBJECTS = [1, 2, 3, 4, 5]5RUN_NUM = 16FWHM_MM = 87AGGREGATION = 'pooled'8def test_get_raw_path():9 paths = [dp.get_raw_path(subject, RUN_NUM) for subject in SUBJECTS]10 assert paths[0] == '{0}/data/raw/sub1_run1_raw.nii'.format(11 REPO_HOME_PATH)12 assert paths[1] == '{0}/data/raw/sub2_run1_raw.nii'.format(13 REPO_HOME_PATH)14def test_get_concatenated_path():15 paths = [dp.get_concatenated_path(subject) for subject in SUBJECTS]16 assert paths[0] == '{0}/data/processed/sub1_rcds.npy'.format(REPO_HOME_PATH)17 assert paths[1] == '{0}/data/processed/sub2_rcds.npy'.format(REPO_HOME_PATH)18 assert paths[2] == '{0}/data/processed/sub3_rcds.npy'.format(REPO_HOME_PATH)19 assert paths[3] == '{0}/data/processed/sub4_rcds.npy'.format(REPO_HOME_PATH)20 assert paths[4] == '{0}/data/processed/sub5_rcds.npy'.format(REPO_HOME_PATH)21def test_get_smoothed_path():22 paths = [dp.get_smoothed_path(subject, FWHM_MM) for subject in SUBJECTS]...
Check out the latest blogs from LambdaTest on this topic:
The fact is not alien to us anymore that cross browser testing is imperative to enhance your application’s user experience. Enhanced knowledge of popular and highly acclaimed testing frameworks goes a long way in developing a new app. It holds more significance if you are a full-stack developer or expert programmer.
QA testers have a unique role and responsibility to serve the customer. Serving the customer in software testing means protecting customers from application defects, failures, and perceived failures from missing or misunderstood requirements. Testing for known requirements based on documentation or discussion is the core of the testing profession. One unique way QA testers can both differentiate themselves and be innovative occurs when senseshaping is used to improve the application user experience.
Having a good web design can empower business and make your brand stand out. According to a survey by Top Design Firms, 50% of users believe that website design is crucial to an organization’s overall brand. Therefore, businesses should prioritize website design to meet customer expectations and build their brand identity. Your website is the face of your business, so it’s important that it’s updated regularly as per the current web design trends.
Enterprise resource planning (ERP) is a form of business process management software—typically a suite of integrated applications—that assists a company in managing its operations, interpreting data, and automating various back-office processes. The introduction of a new ERP system is analogous to the introduction of a new product into the market. If the product is not handled appropriately, it will fail, resulting in significant losses for the business. Most significantly, the employees’ time, effort, and morale would suffer as a result of the procedure.
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!!