Esempio n. 1
0
 def testCanBeCompared(self):
     with tempfile.TemporaryDirectory () as tmp:
         f = os.path.join (tmp, 'foo.fsproj')
         touch (f)
         fs_project_1 = FSharpProjectFile.from_path(f)
         fs_project_2 = FSharpProjectFile.from_path(f)
         self.assertEquals(fs_project_1, fs_project_2)
Esempio n. 2
0
 def testCanDetectCodeForCodeFile(self):
     with tempfile.TemporaryDirectory () as tmp:
         f = os.path.join (tmp, 'foo.fs')
         touch (f)
         v = self.win.open_file(f)
         time.sleep(0.01)
         fs_file = FSharpFile (v)
         self.assertTrue (fs_file.is_code)
Esempio n. 3
0
 def test_governs_SameLevel(self):
     with tempfile.TemporaryDirectory () as tmp:
         f = os.path.join (tmp, 'foo.fsproj')
         f2 = os.path.join (tmp, 'foo.fs')
         touch (f)
         touch (f2)
         fs_proj = FSharpProjectFile.from_path(f)
         self.assertTrue(fs_proj.governs (f2))
Esempio n. 4
0
 def testCanReturnParent(self):
     with tempfile.TemporaryDirectory () as tmp:
         f = os.path.join (tmp, 'foo.fsproj')
         touch (f)
         fs_project = FSharpProjectFile.from_path(f)
         self.assertEquals(fs_project.parent, tmp)
Esempio n. 5
0
 def testCanCreateFromPath(self):
     with tempfile.TemporaryDirectory () as tmp:
         f = os.path.join (tmp, 'foo.fsproj')
         touch (f)
         fs_project = FSharpProjectFile.from_path(f)
         self.assertEquals(fs_project.path, f)
Esempio n. 6
0
 def testCanFind(self):
     with make_directories([["foo", "bar", "baz"]]) as tmp_root:
         fs_proj_file = os.path.join(tmp_root, 'hey.fsproj')
         touch(fs_proj_file)
         found = find_fsproject (os.path.join (tmp_root, 'foo/bar/baz'))
         self.assertEquals(found, fs_proj_file)