Esempio n. 1
0
    def test_paths_windows(self, _, mock_open_file):
        """Checking handling of windows filenames: test gh-616"""

        # this filename has a semi-colon to check for
        # regression of gh-616 (in ptdump)
        src_fn = 'D:\\window~1\\path\\000\\ptdump'
        src_path = '/'

        argv = ['ptdump', src_fn + ':' + src_path]
        with patch.object(sys, 'argv', argv):
            ptdump.main()

        args, kwargs = mock_open_file.call_args_list[0]
        self.assertEqual(args, (src_fn, 'r'))
Esempio n. 2
0
    def test_paths_windows(self, _, mock_open_file):
        """Checking handling of windows filenames: test gh-616"""

        # this filename has a semi-colon to check for
        # regression of gh-616 (in ptdump)
        src_fn = 'D:\\window~1\\path\\000\\ptdump'
        src_path = '/'

        argv = ['ptdump', src_fn + ':' + src_path]
        with patch.object(sys, 'argv', argv):
            ptdump.main()

        args, kwargs = mock_open_file.call_args_list[0]
        self.assertEqual(args, (src_fn, 'r'))
Esempio n. 3
0
if __name__ == '__main__':
    import sys
    from tables.scripts.ptdump import main

    sys.exit(main())