Пример #1
0
 def test_run_found_command(self):
     with open('hello.py', 'w') as f:
         f.write('print("Hello, world!")')
     cmd = find_command('hello')
     if not cmd:
         raise unittest.SkipTest('.py not in PATHEXT or not registered')
     p = capture_stdout('hello')
     self.assertEqual(p.stdout.text.rstrip(), 'Hello, world!')
Пример #2
0
 def test_run_found_command(self):
     with open('hello.py', 'w') as f:
         f.write('print("Hello, world!")')
     cmd = find_command('hello')
     if not cmd:
         raise unittest.SkipTest('.py not in PATHEXT or not registered')
     p = capture_stdout('hello')
     self.assertEqual(p.stdout.text.rstrip(), 'Hello, world!')
Пример #3
0
 def test_run_found_command(self):
     with open("hello.py", "w") as f:
         f.write('print("Hello, world!")')
     cmd = find_command("hello")
     if not cmd:
         raise unittest.SkipTest(".py not in PATHEXT or not registered")
     p = capture_stdout("hello")
     self.assertEqual(p.stdout.text.rstrip(), "Hello, world!")
Пример #4
0
 def test_find_command(self):
     cmd = find_command('dummy.py')
     self.assertTrue(cmd is None or pyrunner_re.match(cmd))
     cmd = find_command('dummy.pyw')
     self.assertTrue(cmd is None or pywrunner_re.match(cmd))
Пример #5
0
 def test_find_command(self):
     cmd = find_command('dummy.py')
     self.assertTrue(cmd is None or pyrunner_re.match(cmd))
     cmd = find_command('dummy.pyw')
     self.assertTrue(cmd is None or pywrunner_re.match(cmd))