Best Python code snippet using localstack_python
test_converted_types.py
Source:test_converted_types.py
...40 converted_type=pt.ConvertedType.TIME_MILLIS,41 )42 assert (convert(np.array([731888], dtype='int32'), schema)[0] ==43 np.array([731888], dtype='timedelta64[ms]'))44def test_timestamp_millis():45 """Test int64 encoding a datetime."""46 schema = pt.SchemaElement(47 type=pt.Type.INT64,48 name="test",49 converted_type=pt.ConvertedType.TIMESTAMP_MILLIS,50 )51 assert (convert(np.array([1099511625014], dtype='int64'), schema)[0] ==52 np.array(datetime.datetime(2004, 11, 3, 19, 53, 45, 14 * 1000),53 dtype='datetime64[ns]'))54def test_utf8():55 """Test bytes representing utf-8 string."""56 schema = pt.SchemaElement(57 type=pt.Type.BYTE_ARRAY,58 name="test",...
test_common.py
Source:test_common.py
...32 self.assertEqual(env, None)33 def test_mktime(self):34 env = common.mktime(datetime(2010, 3, 20, 7, 24, 00, 0), True)35 self.assertEqual(env, 1269069840.0)36 def test_timestamp_millis(self):37 result = common.timestamp_millis(datetime.now())38 self.assertIn('T', result)39 result = common.timestamp_millis(date.today())40 self.assertIn('00:00:00', result)41 self.assertIn('T', result)42 def test_extract_jsonpath(self):43 obj = {'a': {'b': [{'c': 123}, 'foo']}, 'e': 234}44 result = common.extract_jsonpath(obj, '$.a.b')45 self.assertEqual(result, [{'c': 123}, 'foo'])46 result = common.extract_jsonpath(obj, '$.a.b.c')47 self.assertFalse(result)48 result = common.extract_jsonpath(obj, '$.foobar')49 self.assertFalse(result)50 result = common.extract_jsonpath(obj, '$.e')...
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!!