test_boost_wide_report.py

来自「C++的一个好库。。。现在很流行」· Python 代码 · 共 37 行

PY
37
字号
import unittest
import sys
import time

sys.path.append( ".." )

import boost_wide_report

class test_boost_wide_report(unittest.TestCase):
    def test_diff( self ):
        test_cases = [
              ( []
                , []
                , ( [], [] ) )
            , ( [ boost_wide_report.file_info( "a", 1, time.localtime( 0 ) ) ]
                , []
                , ( [ "a" ], [] ) )
            , ( []
                , [ boost_wide_report.file_info( "a", 1, time.localtime( 0 ) ) ]
                , ( [], [ "a" ] ) )
            , ( [ boost_wide_report.file_info( "a", 1, time.localtime( 0 ) ) ]
                , [ boost_wide_report.file_info( "a", 1, time.localtime( 1 ) ) ]
                , ( [ "a" ], [] ) )
            ]

        for test_case in test_cases:
            source_dir_content = test_case[0]
            destination_dir_content = test_case[1]
            expected_result = test_case[2]
            d = boost_wide_report.diff( source_dir_content, destination_dir_content )
            self.failUnlessEqual( d, expected_result )

if __name__ == '__main__':
    unittest.main()
            
            

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?