Best Python code snippet using localstack_python
test_common.py
Source:test_common.py
...50 dt = datetime(2001, 9, 9, 1, 46, 40, 0, tzinfo=pytz.utc)51 self.assertEqual(1000000000, int(common.mktime(dt)))52 dt = datetime(2001, 9, 9, 1, 46, 40, 0, tzinfo=pytz.timezone("EST"))53 self.assertEqual(1000000000 + (5 * 60 * 60), int(common.mktime(dt))) # EST is UTC-554 def test_mktime_millis_with_tz(self):55 # see https://en.wikipedia.org/wiki/File:100000000056 dt = datetime(2001, 9, 9, 1, 46, 40, 0, tzinfo=pytz.utc)57 self.assertEqual(1000000000, int(common.mktime(dt, millis=True) / 1000))58 dt = datetime(2001, 9, 9, 1, 46, 40, 0, tzinfo=pytz.timezone("EST"))59 self.assertEqual(60 1000000000 + (5 * 60 * 60), int(common.mktime(dt, millis=True)) / 100061 ) # EST is UTC-562 def test_mktime_millis(self):63 now = common.mktime(datetime.now(), millis=True)64 self.assertEqual(int(now / 1000), int(time.time()))65 def test_timestamp_millis(self):66 result = common.timestamp_millis(datetime.now())67 self.assertIn("T", result)68 result = common.timestamp_millis(date.today())...
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!!