示例#1
0
    def test_server(self):
        addr = Address.as_server('10.0.1.1', 8888)
        run_module(addr, 'spam', _run=self._run, _prog='eggs')

        self.assertEqual(self.argv,
                         _get_args('--module', '--file', 'spam:'))

        self.assertEqual(self.addr, Address.as_server(*addr))
        self.assertEqual(self.kwargs, {})
示例#2
0
    def test_executable(self):
        addr = (None, 8888)
        run_module(addr, 'spam', _run=self._run)

        self.assertEqual(self.argv,
                         _get_args(
                             '--module', '--file', 'spam:',
                             prog=sys.argv[0]))

        self.assertEqual(self.addr, Address.as_server(*addr))
        self.assertEqual(self.kwargs, {})
示例#3
0
    def test_extra(self):
        addr = (None, 8888)
        run_module(addr, 'spam', '--vm_type', 'xyz', '--', '--DEBUG',
                   _run=self._run, _prog='eggs')

        self.assertEqual(self.argv,
                         _get_args(
                             '--module', '--file', 'spam:', '--DEBUG',
                             ptvsd_extras=['--vm_type', 'xyz']))

        self.assertEqual(self.addr, Address.as_server(*addr))
        self.assertEqual(self.kwargs, {})
示例#4
0
    def test_remote(self):
        addr = ('1.2.3.4', 8888)
        run_module(addr, 'spam', _run=self._run, _prog='eggs')

        self.assertEqual(self.argv,
                         _get_args('--module', '--file', 'spam:',
                                   ptvsd_extras=['--client', '1.2.3.4']))

        self.assertEqual(self.addr, Address.as_client(*addr))
        self.assertEqual(self.kwargs, {
            'singlesession': True,
        })