test_utils.py 文件源码

python
阅读 25 收藏 0 点赞 0 评论 0

项目:python-zhmcclient 作者: zhmcclient 项目源码 文件源码
def test_success_datetime_from_timestamp(self, datetime_tuple, timestamp):
        """Test successful calls to datetime_from_timestamp()."""

        if os.name == 'nt' and timestamp > TS_3001_LIMIT:
            # Skip this test case, due to the lower limit on Windows
            return

        # Create the expected datetime result (always timezone-aware in UTC)
        dt_unaware = datetime(*datetime_tuple)
        exp_dt = pytz.utc.localize(dt_unaware)

        # Execute the code to be tested
        dt = datetime_from_timestamp(timestamp)

        # Verify the result
        assert dt == exp_dt
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号