Beispiel #1
0
        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);
        }
Beispiel #2
0
        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);
        }
Beispiel #3
0
        public void DirectoryPropertyReturnsPython26LibDirectoryAndPython26LibTkDirectory()
        {
            PythonStandardLibraryPath path = new PythonStandardLibraryPath(@"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 #4
0
        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 #5
0
 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);
 }
        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);
        }
Beispiel #7
0
        public void HasPathReturnsFalseForEmptyPathString()
        {
            PythonStandardLibraryPath path = new PythonStandardLibraryPath(String.Empty);

            Assert.IsFalse(path.HasPath);
        }
Beispiel #8
0
        public void HasPathReturnsTrueForNonEmptyPathString()
        {
            PythonStandardLibraryPath path = new PythonStandardLibraryPath(@"c:\python26\lib");

            Assert.IsTrue(path.HasPath);
        }