public void DirectoryPropertyReturnsPython26LibDirectoryAndPython26LibTkDirectorySetInPathProperty()
		{
			PythonStandardLibraryPath path = new PythonStandardLibraryPath(String.Empty);
			path.Path = @"c:\python26\lib;c:\python26\lib\lib-tk";
			string[] expectedPaths = new string[] { @"c:\python26\lib", @"c:\python26\lib\lib-tk" };
			Assert.AreEqual(expectedPaths, path.Directories);
		}
		public void DirectoriesAreClearedWhenPathIsSetToDifferentValue()
		{
			PythonStandardLibraryPath path = new PythonStandardLibraryPath(@"c:\temp");
			path.Path = @"c:\python26\lib;c:\python26\lib\lib-tk";
			string[] expectedPaths = new string[] { @"c:\python26\lib", @"c:\python26\lib\lib-tk" };
			Assert.AreEqual(expectedPaths, path.Directories);
		}
Beispiel #3
0
 public PythonTestRunner(PythonTestRunnerContext context)
     : base(context)
 {
     this.options = context.Options;
     this.pythonStandardLibraryPath = context.PythonStandardLibraryPath;
     this.fileService = context.ScriptingFileService;
 }
		public PythonTestRunner(PythonTestRunnerContext context)
			: base(context)
		{
			this.options = context.Options;
			this.pythonStandardLibraryPath = context.PythonStandardLibraryPath;
			this.fileService = context.ScriptingFileService;
		}
		public PythonTestRunnerApplication(string testResultsFileName,
			PythonAddInOptions options,
			PythonStandardLibraryPath pythonStandardLibraryPath,
			IScriptingFileService fileService)
		{
			this.testResultsFileName = testResultsFileName;
			this.options = options;
			this.pythonStandardLibraryPath = pythonStandardLibraryPath;
			this.fileService = fileService;
			consoleApplication = new PythonConsoleApplication(options);
		}
 public PythonTestRunnerApplication(string testResultsFileName,
                                    PythonAddInOptions options,
                                    PythonStandardLibraryPath pythonStandardLibraryPath,
                                    IScriptingFileService fileService)
 {
     this.testResultsFileName       = testResultsFileName;
     this.options                   = options;
     this.pythonStandardLibraryPath = pythonStandardLibraryPath;
     this.fileService               = fileService;
     consoleApplication             = new PythonConsoleApplication(options);
 }
		public PythonTestDebugger(IUnitTestDebuggerService debuggerService,
			IUnitTestMessageService messageService,
			ITestResultsMonitor testResultsMonitor,
			PythonAddInOptions options,
			PythonStandardLibraryPath pythonStandardLibraryPath,
			IScriptingFileService fileService)
			: base(debuggerService, messageService, testResultsMonitor)
		{
			this.options = options;
			this.pythonStandardLibraryPath = pythonStandardLibraryPath;
			this.fileService = fileService;
		}
		void CreateTestDebugger()
		{
			debuggerService = new MockDebuggerService();
			debugger = debuggerService.MockDebugger;
			messageService = new MockMessageService();
			testResultsMonitor = new MockTestResultsMonitor();
			options = new PythonAddInOptions(new Properties());
			options.PythonFileName = @"c:\ironpython\ipy.exe";
			standardLibraryPath = new PythonStandardLibraryPath(@"c:\python\lib");
			fileService = new MockScriptingFileService();
			testDebugger = new PythonTestDebugger(debuggerService, messageService, testResultsMonitor, options, standardLibraryPath, fileService);
		}
		public PythonTestRunnerContext(IUnitTestProcessRunner processRunner,
			ITestResultsMonitor testResultsMonitor,
			IUnitTestMessageService messageService,
			PythonAddInOptions options,
			PythonStandardLibraryPath pythonStandardLibraryPath,
			IScriptingFileService fileService)
			: base(processRunner, testResultsMonitor, fileService, messageService)
		{
			this.options = options;
			this.pythonStandardLibraryPath = pythonStandardLibraryPath;
			this.fileService = fileService;
		}
 public PythonTestRunnerContext(IUnitTestProcessRunner processRunner,
                                ITestResultsMonitor testResultsMonitor,
                                IUnitTestMessageService messageService,
                                PythonAddInOptions options,
                                PythonStandardLibraryPath pythonStandardLibraryPath,
                                IScriptingFileService fileService)
     : base(processRunner, testResultsMonitor, fileService, messageService)
 {
     this.options = options;
     this.pythonStandardLibraryPath = pythonStandardLibraryPath;
     this.fileService = fileService;
 }
Beispiel #11
0
 public PythonTestDebugger(IUnitTestDebuggerService debuggerService,
                           IUnitTestMessageService messageService,
                           ITestResultsMonitor testResultsMonitor,
                           PythonAddInOptions options,
                           PythonStandardLibraryPath pythonStandardLibraryPath,
                           IScriptingFileService fileService)
     : base(debuggerService, messageService, testResultsMonitor)
 {
     this.options = options;
     this.pythonStandardLibraryPath = pythonStandardLibraryPath;
     this.fileService = fileService;
 }
		void CreateTestRunner()
		{
			processRunner = new MockProcessRunner();
			testResultsMonitor = new MockTestResultsMonitor();
			options = new PythonAddInOptions(new Properties());
			options.PythonFileName = @"c:\ironpython\ipy.exe";
			fileService = new MockScriptingFileService();
			messageService = new MockMessageService();
			standardLibraryPath = new PythonStandardLibraryPath(@"c:\python\lib");
			PythonTestRunnerContext context = new PythonTestRunnerContext(processRunner, 
				testResultsMonitor, 
				messageService,
				options,
				standardLibraryPath,
				fileService);
			
			testRunner = new PythonTestRunner(context);
		}
		public void DirectoryWithJustWhitespaceIsNotAddedToPath()
		{
			PythonStandardLibraryPath path = new PythonStandardLibraryPath(@"c:\temp;    ;c:\python\lib");
			string[] expectedPaths = new string[] { @"c:\temp", @"c:\python\lib" };
			Assert.AreEqual(expectedPaths, path.Directories);
		}
		public void PathsPropertyReturnsPython26LibDirectory()
		{
			PythonStandardLibraryPath path = new PythonStandardLibraryPath(@"c:\python26\lib");
			string[] expectedPaths = new string[] { @"c:\python26\lib" };
			Assert.AreEqual(expectedPaths, path.Directories);
		}
		public void HasPathReturnsFalseForEmptyPathString()
		{
			PythonStandardLibraryPath path = new PythonStandardLibraryPath(String.Empty);
			Assert.IsFalse(path.HasPath);
		}
		public void HasPathReturnsTrueForNonEmptyPathString()
		{
			PythonStandardLibraryPath path = new PythonStandardLibraryPath(@"c:\python26\lib");
			Assert.IsTrue(path.HasPath);
		}
		public void EmptyDirectoryInPathNotAddedToDirectories()
		{
			PythonStandardLibraryPath path = new PythonStandardLibraryPath(@"c:\temp;;c:\python\lib");
			string[] expectedPaths = new string[] { @"c:\temp", @"c:\python\lib" };
			Assert.AreEqual(expectedPaths, path.Directories);
		}